complex

Construct complex fi object from real and imaginary parts

Syntax

c = complex(a,b)
c = complex(a)

Description

The complex function constructs a complex fi object from real and imaginary parts.

c = complex(a,b) returns the complex result a + bi, where a and b are identically sized real N-D arrays, matrices, or scalars of the same data type. When b is all zero, c is complex with an all-zero imaginary part. This is in contrast to the addition of a + 0i, which returns a strictly real result.

c = complex(a) for a real fi object a returns the complex result a + bi with real part a and an all-zero imaginary part. Even though its imaginary part is all zero, c is complex.

The numerictype and fimath objects of the leftmost input that is a fi object are applied to the output c.

See Also

imag, real

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS