Sort input elements by value
DSP System Toolbox / Statistics
The Sort block ranks the values of the input elements along each
channel (column) in an Ascending
or a
Descending
order, based on the Sort
order you specify. Complex inputs are sorted by their magnitude, which is
the sum of the squares of the real and imaginary components of the input. You can choose
the Sort algorithm to be either Quick
sort
or Insertion sort
. The quick sort
algorithm uses a recursive sort method and is faster at sorting more than 32 elements.
The insertion sort algorithm uses a nonrecursive method and is faster at sorting fewer
than 32 elements. When you generate code, use the insertion sort algorithm to avoid
recursive function calls.
The Mode parameter specifies the block's mode of operation, which
you can set to Value
, Index
, or
Value and Index
.
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 
