PAIRCONJ Function

Sorts one-dimensional array of complex values into complex conjugate pairs.

Usage

result = PAIRCONJ(z)

Input Parameters

z—A one-dimensional array of complex values.

Returned Value

result—Complex array with values sorted into complex conjugate pairs.

Keywords

None.

Discussion

PAIRCONJ returns a one-dimensional array containing the input data, but rearranged into complex conjugate pairs. If there are values in z that do not appear to match up, they are put at the end of the output array. If there are an odd number of complex values in z (with the imaginary part not equal to zero), the function returns 0 and an error message.

Example

In this example, PAIRCONJ is used on two sets of complex conjugate pairs. PAIRCONJ returns the data as one set of ordered complex conjugate pairs.

; The input is a simple array of complex conjugates all mixed up.
z = COMPLEX([2,1,2,1],[9,-3,-9,3])
PM, z
; Complex values are output in conjugate pairs.
z2 = PAIRCONJ(z)
PM, z2

See Also

PAIRINV