3.5.1.4.26 Real2Complex

Contents

Description

This function is used to convert the specified two reals into a complex number.

Note that the output for this function are complex values, so when doing calculation on data columns, you need to set column data type to complex prior to set column formula. For details, see the section below.

Syntax

complex Real2Complex(double d1, double d2)

Parameters

d1

The real number for the real part of complex.

d2

The real number for the imaginary part of complex.

Return

Return a complex number.

Example

EX1

complex c = real2complex(1, 2);
c = ;  // c=1+2i

EX2

// Set data type of column C to complex 16 in advance
wks.col3.numerictype = 11;

// Generate a set of complex numbers and put to column C
col(C) = real2complex(col(A), col(B));

EX3: Set col(C) values by following formula in F(x)

= real2complex(A,B[i])

See Also

,