- `Y = sort (X)`
- `Y = sort (X, DIM)`
- `Y = sort (X, MODE)`
- `[Y, I] = sort (...)`

Return a sorted copy of `X`.

The optional `DIM` argument selects the dimension to sort along. The optional
`MODE` argument controls ascending or descending order. With two outputs,
return the sorting permutation indices.

See also: `max`, `min`.

### References

- https://www.mathworks.com/help/matlab/ref/sort.html
- https://octave.sourceforge.io/octave/function/sort.html
