MxSortRows
|
Matrix functions |
SYNTAX | MxSortRows( mx, ascending = True, col1 = 0, col2 = -1, col3 = -1 ) |
RETURNS | Matrix |
FUNCTION | Sorts the rows of the matrix in ascending/descending order of the col1 column. When the col1 column has equal values, SortRows sorts according to the col2 and col3 columns in succession (if col2 and col3 are specified and >= 0 ).Column numbers are zero based.
Hint: if you want to sort columns instead you can Transpose/Sort rows/Transpose back. |
EXAMPLE | m = MxFromString("[
9, 1, 6; 40, 30, 20; 8, 7, 3; 3, 5, 1 ]"); |
SEE ALSO | Matrix() function , MxTranspose() function |
The MxSortRows function is used in the following formulas in AFL on-line library:
See updated/extended version on-line.