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

Home » Public Forums » archive » Re: How do you sort an array in IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How do you sort an array in IDL? [message #11486 is a reply to message #11484] Thu, 02 April 1998 00:00 Go to previous messageGo to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Robert A. Lematta wrote:
> Does anyone know how to sort an array in idl (ala excell) while preserving
> the order of the other columns. For example, if I have a 10 by 10 array
> with the second column being time, how do I sort the entire array by time and
> have the values in the other columns follow. Like you'd do a sort in a
> spreadsheet. Please reply to lematta@spawar.navy.mil. Many thanks in advance.
> I've tried to figure out the sort function but I don't think it works on > arrays with more than one row or column.

How about this:

a=dist(10)
print,a,format='(10f6.3)'
idx=sort(a(1,*))
b=a(*,idx)
print,b,format='(10f6.3)'

Cheers,
Liam.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Write-mask problem with "win" device?
Next Topic: drawing a shaded sphere

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

Current Time: Sun Oct 12 07:40:30 PDT 2025

Total time taken to generate the page: 0.24372 seconds