MATLAB Function Reference
  Go to function:
    Search    Help Desk 
complex    Examples   See Also

Construct complex data from real and imaginary components

Syntax

Description

c = complex(a,b) creates a complex output, c, from the two real inputs.

The output is the same size as the inputs, which must be equally sized vectors, matrices, or multi-dimensional arrays.

The complex function provides a useful substitute for expressions such as

in cases when the names "i" and "j" may be used for other variables (and do not equal ), or when a and b are not double precision.

c = complex(a) uses input a as the real component of the complex output. The imaginary component is zero.

Example

Create complex uint8 vector from two real uint8 vectors.

See Also

imag, real



[ Previous | Help Desk | Next ]