sort — Sort Matrix


\begin{rail}
Sort : 'sort' '(' Matrix ')' ;
\end{rail}
sort has two different forms, depending on its argument. If the argument is a row or column vector, a list containing two vectors is returned. Both vectors will be the same size as the argument. One vector will be named val, and will contain the same elements as the argument, but sorted in ascending magnitude. The other vector is named ind, and tells you where the val element associated with it was in the argument. If the argument is a string vector, then the sorting is done in alphabetical order. If the argument is not a vector, then the same thing happens, except that each column of the argument is sorted in turn.

Subsections