Navigation
Main Page
Random Page
Create a new Page
All Pages
Categories
Administration
File Management
Login/Logout
Language Selection
Your Profile
Create Account
Quick Search
Advanced Search »
Back
History
sorting
Here are vector/matrix built in sorting functions: '''sort'''('vector') - Returns a 'vector' with the values sorted in ascending order. '''rsort'''('matrix/vector','number') - Returns a 'matrix/vector' formed by rearranging columns until specified row,'number', is in ascending order. '''csort'''('matrix/vector','number') - Returns a 'matrix/vector' formed by rearranging rows until specified column,'number', is in ascending order. '''reverse'''('matrix/vector') - Reverses the order of rows in a matrix, or of elements in a vector. A simple example of using these functions is presented: [image|sorting|{UP}sorting/sorting.png] HINT: 2D plot can be represented as two-column matrix. The first column is x-vector and the second is y-vector. If we want to sort this matrix first and then plotting, we need to use [[eval]]. [image|sortplotting|{UP}sorting/sortingplot.png]
ScrewTurn Wiki
version 2.0.37. Some of the icons created by
FamFamFam
.