Sort
This block outputs a sorted version of its input matrix.
Library
MatrixOperations
Description
This block outputs a sorted version of its input matrix, the size of output is the same as input's. The order of the sorted results can be selected to be "Ascending" or "Descending". When input signal is complex, sorting can be specified to sort by "Magnitude", "Real part" or "Complex part". This block can output the indices of the sorted results, which indicate the mapping between the sorted results and original input matrix, the indices are based on 0.
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
algo | Sorting method | Define the algorithm for sorting the elements of the input matrix. At present, Quick-sort is the only method available. | String | 'quicksort' |
incdec | Ascending or descending | Defines the order in which the input matrix should be sorted. | String | 'Ascending' |
cmplx | Sort complex numbers according to | If the datatype is complex, this parameter is used to define the sorting criterion. | String | 'Magnitude' |
indexoutput | Output indices | If enabled, an extra output provides the indices of the sorted matrix. | Number | 0 |
onebased | One-based indexing | Select the check box to start the output indices from one instead of zero. | Number | 0 |
externalActivation | External activation | Specifies whether the block receives an external activation or inherits its activation through its regular input ports. When External Activation is selected, an additional activation port is added to the block. By default, external activation is not selected. | Number | 0 |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
Port 1 | explicit | input | 1 | |
Port 2 | explicit | output | 1+indexoutput | |
Port 3 | activation | input | externalActivation |
Advanced Properties
Name | Value | Description |
---|---|---|
always active | no | |
direct-feedthrough | yes | |
zero-crossing | no | |
mode | no | |
continuous-time state | no | |
discrete-time state | no |