comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Array sorting by row
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Array sorting by row [message #49832] Thu, 17 August 2006 01:47 Go to previous message
humphreymurray is currently offline  humphreymurray
Messages: 8
Registered: August 2006
Junior Member
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.
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Array sorting by row
Next Topic: Re: jpeg text field

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 08:45:07 PDT 2025

Total time taken to generate the page: 0.00655 seconds