Sorting Functions
SMath has the following built-in vector/matrix sorting functions:
sort('vector')returnsvectorwith its values sorted in ascending order.rsort('matrix/vector','number')returnsmatrix/vectorwith its columns rearranged until the specified row,number, is in ascending order.csort('matrix/vector','number')returnsmatrix/vectorwith its rows rearranged until the specified column,number, is in ascending order.reverse('matrix/vector')reverses the order of the rows of a matrix, or of the elements of a vector.
Here is a simple example of using these functions:

Note: a 2D plot can be represented as a two-column matrix, where the first column is the x-vector and the second is the y-vector. If you want to sort this matrix before plotting, use eval().

This page is based on a legacy wiki article by Radovan Omorjan.