Sorry for the confusion in my earlier post. I meant something else with my question:
I have an arry like this:
A = [2.4 1.2 4.1 3.1]
I am looking for a way to "rank" the elements in A. That is, when I sort this array (descending), I need the array of the ranks each element had in the original array A. So for example, 4.1 in A is the largest element and thus has rank 1. Element 3.1 is the second largest, so it has rank 2, and so on. So finally, I have this:
A = [2.4 1.2 4.1 3.1]
Ranks = [ 3 4 1 2 ]
I am looking for a routine to find "Ranks" above. Any suggestions?