Sort Complex Numbers VI

Owning Palette: Polynomial VIs

Requires: Full Development System

Sorts an array of complex numbers in ascending or descending order with respect to real and imaginary parts or magnitude.

 Add to the block diagram  Find on the palette
Complex Numbers contains the complex numbers to sort.
order specifies in what order the VI sorts Complex Numbers.

0Ascending (default)
1Descending
method specifies the sorting criteria. If you set method to Magnitude, Real, Imaginary, the VI sorts elements with respect to their magnitude first. For the elements with the same magnitude, the VI sorts them with respect to their real parts and then with respect to their imaginary parts.

0Real & Imaginary (default)—The VI sorts the elements with respect to their real parts first. For the elements with same real parts, the VI sorts them by their imaginary parts.
1Magnitude, Real, Imaginary—The VI sorts the elements with respect to their magnitude first. For the elements with same magnitude, the VI sorts them by their real parts and then by their imaginary parts.
2Magnitude, Phase Angle—The VI sorts the elements with respect to their magnitude first. For the elements with same magnitude, the VI sorts them by their phase angle. The phase angle is in the ranges of negative pi to pi.
Sorted Complex Numbers returns the complex numbers sorted according to order.
Sorted Index returns for each element of Sorted Complex Numbers the corresponding index in Complex Numbers.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.