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


icon

Inputs/Outputs

  • c1dcdb.png Complex Numbers

    Complex Numbers contains the complex numbers to sort.

  • cenum.png order

    order specifies in what order the VI sorts Complex Numbers.

    0
    Ascending
    (default)
    1
    Descending
  • cu16.png method

    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.
  • i1dcdb.png Sorted Complex Numbers

    Sorted Complex Numbers returns the complex numbers sorted according to order.

  • i1di32.png Sorted Index

    Sorted Index returns for each element of Sorted Complex Numbers the corresponding index in Complex Numbers.

  • ii32.png error

    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.