Sort rows of array

Syntax and Description

sortrows(A) sorts the rows of A in ascending order of the first column. When the first column has equal values, sortrows sorts according to the next column and repeats this behavior for succeeding equal values.
sortrows(A,column) sorts matrix A based on the columns specified in the vector, column. This input is used to perform multiple column sorts in succession. For equal values, the original order is preserved.

Back to functions