Hi,
In IDL, is there a way to independly sort the columns of a 2d matrix
without looping through and sorting each row individually?
Currenly I'm using:
for x = long(0), x_size - 1 do begin
sorted_indexs[0,x] = sort(matrix[*,x])
endfor
For example, if the matrix contained the following values:
4 2 0 5
9 0 1 5
0 4 2 1
1 2 3 4
I want the result matrix to contain index's like:
2 1 0 3
1 2 3 0
0 3 2 1
0 1 2 3
Here, each column is sorted as if it's an independant vector.
Cheers.


|