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

Home » Public Forums » archive » Re: sorting array column/rowwise
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: sorting array column/rowwise [message #31326 is a reply to message #31324] Wed, 03 July 2002 15:27 Go to previous message
Paul Sorenson is currently offline  Paul Sorenson
Messages: 48
Registered: May 2002
Member
Have you looked at the SORT routine? The following example sorts by the
first column of a.

IDL> a = randomu(seed, 4, 4)
IDL> print, a[*, sort(a[0, *])]
0.303753 0.933435 0.723623 0.636985
0.535081 0.804346 0.313356 0.620587
0.574060 0.790996 0.821293 0.671731
0.799868 0.0666149 0.123060 0.281230

There's also a routine called BSORT at
http://idlastro.gsfc.nasa.gov/ftp/pro/misc/bsort.pro . It is like the IDL
SORT function but subscript order is maintained when values are equal.

-Paul Sorenson

"Marc Schellens" <m_schellens@hotmail.com> wrote in message
news:3D2295BC.5030207@hotmail.com...
> Is there an elegant (ie. without loops) way to sort
> the columns or rows of an array?
> I need the sorted indices.
> thanks,
> marc
>




-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: gamma correction
Next Topic: write_jpeg and TVRD()

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

Current Time: Wed Oct 22 18:30:11 PDT 2025

Total time taken to generate the page: 1.11866 seconds