Qu

im

Builtin index · Core maths

result = im(x)

Input: x · Output: result

What it is

Imaginary component of a Complex/CVec/CMat (0 elementwise when x is real). x is a scalar, Vec, or Mat (real or complex).

Overloads

x can be scalar, Vec, Mat, or Complex.

2 forms. Each carries its own inputs, outputs and worked example — pick the tab for the one you are calling.

CodeInputOutputDescription
result = im(x)
x scalar, Vec, or Matnot documented yet
result Complex, Num, CVec, Vec, CMat, or Mat
Always 0, since a real value has no imaginary part.

Examples

Written for this form and run by the build -- the output below is what the engine actually produced.

print(im(5))   # 0

output
0
CodeInputOutputDescription
result = im(x)
x Complexnot documented yet
result —
Returns just the imaginary component.

Examples

Written for this form and run by the build -- the output below is what the engine actually produced.

print(im(3 + 4j))   # 4

output
4

See also

imag — documented in the same entry.