Functions > Vector and Matrix > Other Array Functions > Example: Ranking and Ordering Vectors
  
Example: Ranking and Ordering Vectors
1. Define a vector.
Click to copy this expression
2. Use the Rank function to get the sorted positions of each element of the vector.
Click to copy this expression
3. Use the order function to get the indices in which the elements of the vector are sorted.
Click to copy this expression
4. Modify the vector so that it has two identical elements and call Rank and order.
Click to copy this expression
Click to copy this expressionClick to copy this expression
For identical elements, Rank returns an average of the indices where the values occur after sorting. The order function generates sequential indices based on their original order in the vector.