Converts an expression tocomplex data type.
Extracts data from an expression and places it in a complex scalar or array.
imaginary (optional) Scalar or array to be used as the imaginary part of the complex result. If not present, the imaginary part of the result is zero.
offset The offset, in bytes, from the beginning of expr to where the extraction is to begin.
dimi (optional) The dimensions of the result. This parameter may be any scalar expression, and up to eight dimensions may be specified.
If only one parameter is supplied, the imaginary part of the result is 0; otherwise, it is set by the imaginary parameter. Parameters are first converted to single-precision floating-point.
NOTE: If three or more parameters are supplied, COMPLEX extracts fields of data from expr, rather than performing conversion.
real = INDGEN(5) b = COMPLEX(real) INFO, b
B COMPLEX = Array(5)
PRINT, b
( 0.00000, 0.00000)
( 1.00000, 0.00000)
( 2.00000, 0.00000)
( 3.00000, 0.00000)
( 4.00000, 0.00000)
img = INTARR(5) + 6 c = COMPLEX(real, img) INFO, c
C COMPLEX = Array(5)
PRINT, c
( 0.00000, 6.00000)
( 1.00000, 6.00000)
( 2.00000, 6.00000)
( 3.00000, 6.00000)
( 4.00000, 6.00000)
d = COMPLEX(real, 7) INFO, d
D COMPLEX = Array(5)
PRINT, d
( 0.00000, 7.00000)
( 1.00000, 7.00000)
( 2.00000, 7.00000)
( 3.00000, 7.00000)
( 4.00000, 7.00000)
e = COMPLEX(7, img) INFO, e
E COMPLEX = Array(5)
PRINT, e
( 7.00000, 6.00000)
( 7.00000, 6.00000)
( 7.00000, 6.00000)
( 7.00000, 6.00000)
( 7.00000, 6.00000)
For more information on using this function to extract data, see the PV-WAVE Programmer's Guide.