sort
Sort the input array
Syntax
y = sort ( x,order[=1] )
y = x.sort ( order[=1] )
Inputs
| Argument | Type | Description | Unit |
|---|---|---|---|
x | vector | array to sort | n/a |
order | SCL | Direction: positive value for ascending (default); negative value for descending | - |
Outputs / Return Value
y:yis the sorted array ofx. Ifxis a matrix, each row is sorted.
Notes
- Row-wise operation
Examples
Given y = [3 1 8 -2],
y.sort → [-2 1 3 8].
Given y =
[3 1 8 -2
3 5 2 2],
y.sort →
[-2 1 3 8
2 2 3 5]
y.sort(-1) →
[8 3 1 -2
5 3 2 2].
Review Status
- Legacy parameter naming does not exactly match current engine metadata and should be reviewed manually.