conj

Complex conjugate of each element.

Category: Mathematics > Elementary Math

Syntax

Y = conj(X)

Flips the sign of the imaginary part of each element of X.

Description

conj(a + b*i) is a - b*i. Multiplying a number by its conjugate gives the squared magnitude, z * conj(z) = abs(z)^2. Note that the transpose operator ' also conjugates, whereas .' does not; conj is the way to conjugate without transposing.

Input arguments

X
Numeric array. Real values are returned unchanged.

Output arguments

Y
Array of the same size as X.

Example

Conjugates

z = [1+2i, 3-4i, 5];
conj(z)
z .* conj(z)
Output
ans = 1×3 complex

   1.0000 - 2.0000i   3.0000 + 4.0000i   5.0000 - 0.0000i
ans = 1×3

     5    25    25

See also

real imag abs complex