dsort (Control Design and Simulation Module, MathScript Function)
Member of the cdutil class.
Syntax
[q, i] = dsort(l)
Description
Sorts a list of elements in a vector in descending order based on the magnitude of each element.
Inputs
Name | Description |
l | Specifies a vector of elements you want to sort. l is a real or complex vector. |
Outputs
Name | Description |
q | Returns the list of elements in l sorted in descending order. q is a real or complex vector. |
i | Returns the list of indexes this function used to sort l. i is an integer vector. |
Examples
l = [0.1, 0.2, 0.15, 0.3, 0.25][q, i] = dsort(l)