Complex Number Operator (FPScript)

23.08.2021

Combines a real part and an imaginary part into a complex number.

Syntax

(RealPart, ImaginaryPart)

The syntax of the ( , ) operator consists of the following elements:

Element

Description

RealPart

A real numeric expression or a string with the real part.

ImaginaryPart

A real numeric expression or a string with the imaginary part.

Remarks

The operator can process scalar values or entire data series and data matrices. If at least one argument is a data series or a data matrix, then the bundling takes place on a per-element basis and the result is once again a data series or a data matrix. If signals, signal series or space curves are combined, only their Y components are examined. The result then preferably contains the X component and possibly the Z component of Real part. Otherwise, it contains those of Imaginary part. If one of the expressions returns a list, then the operation is executed for each item in the list and the result is also a list.

If one argument is numeric and the other is a string, the string is changed to the numeric type before the operation. Both arguments cannot be strings.

If Real part and ImaginaryPart is a quantity, then they have to have the same SI dimension and the unit of ImaginaryPart is transformed to the unit of RealPart before being combined to become a complex number. If only one argument is a quantity, then the same unit is used for the other argument.

Note:   Instead of this operator, you can also use the imaginary unit i to create complex numbers.

Available in

FlexPro View, Basic, Professional, Developer Suite

Examples

(1, 2.)

Generates the complex 64-bit floating point scalar value (1.,2.).

1 + 2.i

Same as the previous example.

(1n, 2L)

Generates the complex 64-bit integer scalar value (1L, 2L).

({1, 2., 4}, 0)

Generates a data series with three complex 64-bit floating point values. All imaginary parts are 0.

(DataMatrix, DataSeries)

Generates a data matrix with complex values. All columns have the same imaginary parts.

(1 V, 200 mV)

Generates the complex 64-bit floating point quantity (1 V, 0.2 V).

 

See Also

Data Types

Share article or send as email:

You might be interested in these articles