| DSP Blockset | Search  Help Desk |
| Sort | See Also |
Sort the elements in a vector by value.
Library
Statistics, in Math FunctionsDescription
The Sort block sorts the elements in a real input vector by value using a Quicksort algorithm. The output vector, y, contains the input values arranged in order of ascending or descending magnitudes, as specified by the Sort order parameter.[y,i] = sort(u(:)) % equivalent MATLAB code (ascending) [y,i] = flipud(sort(u(:))) % equivalent MATLAB code (descending)The Mode parameter specifies the block's output, and can be set to Value, Index, or Value and Index:
y = u(i)
u(:), rather than column by column.
Note
Dialog Box


See Also
Histogramsort (MATLAB)