|
Contents | Previous | Next | Subchapters |
| Syntax |
sort(matrix, start, width)
|
| See Also | reverse , sort(matrix) , and psort(matrix, start, width) |
/ 1 3 \
| 2 4 |
\ 3 2 /
by the second column, enter
y = {[1, 3], [2, 4], [3, 2]}
sort(y, 2, 1)
O-Matrix will respond
{
[ 3 , 2 ]
[ 1 , 3 ]
[ 2 , 4 ]
}
The sort function can also be used with character matrices.
x = {"Mary Frye", "Joe Friday", "Jack Frost"}
y = align(x, " ", [8, 8])
sort(y, 9, 8)
returns
Joe Friday
Jack Frost
Mary Frye