sort

sort(x)

sort(x, compare)

Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.

Try it yourself:

See also:
All functions