<< prod | Data analysis | sum >> |
B = sort(A) |
B = sort(A, dim) |
B = sort(..., direction) |
B = sort(..., name, value) |
[B, I] = sort(...) |
an nelson's variable (double, single, int8, int16, int32, int64, uint8, uint16, uint32, uint64, logical, char, string, cell).
Dimension to operate along: positive integer scalar.
Sorting direction: 'ascend' (default) or 'descend'.
name-value pair arguments.
sorted array.
sort index.
sort implements quick sort algorithm.
name-value pair arguments:
'MissingPlacement' - Placement of missing values: 'auto' (default), 'first', 'last'.
'ComparisonMethod' - Element comparison method: 'auto' (default), 'real', 'abs'.
ComparisonMethod
A = [10+20i 30+i 10i 0 -10i];
B = sort(A,'ComparisonMethod', 'auto')
B = sort(A, 'ComparisonMethod', 'real')
B = sort(A, 'ComparisonMethod', 'abs')
MissingPlacement
A = [NaN 3 6 0 NaN];
[B, I] = sort(A, 'MissingPlacement', 'auto')
[B, I] = sort(A, 'MissingPlacement', 'first')
[B, I] = sort(A, 'MissingPlacement', 'last')
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET