I'm try to find short, efficient vector operations that efficiently rank entries in a vector by their relative magnitude. For example, if a vector is:
A = [212 314 196];
I want a function that returns:
B = [2 3 1];
I'm messing around with the sort function, but all of my solutions so far have what I think might be an unnecessary for loop. I'm stumped--does anyone know a more elegant way?
Loren has a nice blog entry on inverting the sort order.