Matrix - Sort

This function block will sort the connected matrix MX.

The rows or the columns of the matrix can be sorted in a downward or upward order. The sorting direction will be determined by the input bAscend. The input KeyInd defines the index of the key row or column to be sorted. If the rows are sorted, KeyInd indicates a column, otherwise it indicates a row.

The result will be written back to MX.

Operations

bAscend = HIGH: Ascending order

bAscend = LOW: Descending order

Parameters

The parameter dialog can be used to select whether the rows or the columns of the matrix will be sorted or not.

Signals

Name I/O Type(s) Function
MX I/O UCHAR, WORD, LONG, LONGLONG, FLOAT, DOUBLE In-/output matrix
bAscend I BIT Sorting direction
KeyInd I WORD Key row or column

Visualization

An indication of the operation mode will be shown in the symbol.

Comments

The first row/column of the matrix has the index of 0.

The data type will be assigned by connecting the input signal MX.