Sort

This block outputs a sorted version of its input matrix.

    Sort

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

Sort_0

NameLabelDescriptionData TypeValid 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'
'Descending'

cmplx

Sort complex numbers according to

If the datatype is complex, this parameter is used to define the sorting criterion.

String

'Magnitude'
'Real
part'
'Complex
part'

indexoutput

Output indices

If enabled, an extra output provides the indices of the sorted matrix.

Number

0
1

onebased

One-based indexing

Select the check box to start the output indices from one instead of zero.

Number

0
1

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
1

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

input

1

Port 2

explicit

output

1+indexoutput

Port 3

activation

input

externalActivation

Advanced Properties

NameValueDescription

always active

no

direct-feedthrough

yes

zero-crossing

no

mode

no

continuous-time state

no

discrete-time state

no