Navigation

Operators and Keywords

Function List:

C++ API

: complex (x)
: complex (re, im)

Return a complex value from real arguments.

With 1 real argument x, return the complex result x + 0i.

With 2 real arguments, return the complex result re + im. complex can often be more convenient than expressions such as a + i*b. For example:

complex ([1, 2], [3, 4])
 ⇒ [ 1 + 3i   2 + 4i ]

See also: real, imag, iscomplex, abs, arg.

Package: octave