DSP Blockset
  Go to block:
    Search    Help Desk 
Sort    See Also

Sort the elements in a vector by value.

Library

Statistics, in Math Functions

Description

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.

The Mode parameter specifies the block's output, and can be set to Value, Index, or Value and Index:

Note that a matrix input is sorted as a single vector, u(:), rather than column by column.

Note
If you expect to generate code for the Sort block using the Real-Time Workshop, you should ensure that inputs are contiguous in memory. See the Contiguous Copy block for more information.

Dialog Box

Mode
The block's mode of operation: Output the sorted vector, the index vector, or both.
Sort order 
The order in which to sort the input values, Descending or Ascending. This parameter is not tunable in Simulink's external mode.

See Also

Histogram
Median
sort (MATLAB)


[ Previous | Help Desk | Next ]