Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > IDL > Array sorting b...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 148 of 228
Post > Topic >>

Array sorting by row

by humphreymurray@[EMAIL PROTECTED] Aug 17, 2006 at 01:47 AM

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.
 




 6 Posts in Topic:
Array sorting by row
humphreymurray@[EMAIL PRO  2006-08-17 01:47:31 
Re: Array sorting by row
"Jean H." <j  2006-08-17 10:06:43 
Re: Array sorting by row
humphreymurray@[EMAIL PRO  2006-08-17 19:52:10 
Re: Array sorting by row
"Ed Hyer" <e  2006-08-18 11:12:36 
Re: Array sorting by row
JD Smith <jdsmith@[EMA  2006-08-22 13:48:59 
Re: Array sorting by row
JD Smith <jdsmith@[EMA  2006-08-22 16:35:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 4:40:27 CDT 2008.