Programmer Guide/Command Reference/EVAL/sort: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
;Result: The sorted vector or matrix ''x''. | ;Result: The sorted vector or matrix ''x''. | ||
:{|class=einrahmen | :{|class=einrahmen | ||
!''type'' | !''type'' !! ''i'' !! description | ||
|- | |- | ||
|'''0'''| column index | sort rows of ''x'' ascending by the values of column ''i'' | |'''0'''|| column index || sort rows of ''x'' ascending by the values of column ''i'' | ||
|- | |- | ||
|'''1'''| column index | sort rows of ''x'' descending by the values of column ''i'' | |'''1'''|| column index || sort rows of ''x'' descending by the values of column ''i'' | ||
|- | |- | ||
|'''2'''| row index | sort columns of ''x'' acending by the values of row ''i'' | |'''2'''|| row index || sort columns of ''x'' acending by the values of row ''i'' | ||
|- | |- | ||
|'''3'''| row index | sort columns of ''x'' descending by the values of row ''i'' | |'''3'''|| row index || sort columns of ''x'' descending by the values of row ''i'' | ||
|} | |} | ||
Revision as of 09:18, 11 April 2011
Sort the vector or matrix x.
- Usage
sort(type, x {, i })
- mode
- specifies the sort direction and the row or column containing the data to be sorted
- x
- vector or matrix to be sorted
- i
- row or column containing the sort data; depends ion type (default=0)
- Result
- The sorted vector or matrix x.
type
i
description
0
column index
sort rows of x ascending by the values of column i
1
column index
sort rows of x descending by the values of column i
2
row index
sort columns of x acending by the values of row i
3
row index
sort columns of x descending by the values of row i