AnsweredAssumed Answered

Function with variable length output array

Question asked by GMAPES on Jul 12, 2007
Latest reply on Jul 16, 2007 by GMAPES
I am writing a Genesys 2007.03 function to post-process measured 1-port s-parameter data.
I import the datafile into a dataset called Data1.

The function will calculate mismatch loss. It fails when the reflection coefficient magnitude exceeds 1 because mismatch loss takes the log of 1-(mag)^2).

I want to add a check for points that produce invalide mismatch loss. The function has a for loop that checks each row of the data vector, and then stores the result in an array.

To handle data with different numbers of points (i.e., different numbers of rows in the data vector), I want to declare an output array using the function size(Data1).

The line to define this array is
out = array(size(Data1).

Unfortunately, size(Data1) returns a REAL result, and array(n) requires an INTEGER argument.

Is there a way to either:
a) convert a real number to integer?
b) declare a varaible as an integer?

Many thanks.  

Outcomes