DADiSP Worksheet Functions > Function Categories > Complex Conversions > COMPLEX
Combines two input expressions into complex Cartesian (Real/Imaginary) form.
COMPLEX(val1, val2)
val1 |
- |
A scalar, series or table. |
val2 |
- |
A scalar, series or table. |
Complex scalar, series, or table in Real/Imaginary form.
complex(1, 2)
returns the scalar 1 + 2i.
complex(1)
returns the scalar 1 + 0i.
complex(1..5, 2)
returns the complex series {1+2i, 2+2i, 3+2i, 4+2i, 5+2i}.
complex(W1, W2)
is equivalent to W1 + W2*i for W1 and W2 real series.
Returns a complex value regardless of the input value. If at least one of the input arguments is a series, COMPLEX returns a complex series.
complex(a, b) is equivalent to a + b*i.
For complex inputs, complex(a, b) is equivalent to:
real(a) + real(b)*i.