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

Home » Public Forums » archive » Re: Rank order extraction
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: Rank order extraction [message #39205] Mon, 26 April 2004 15:49
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Jonathan Greenberg wrote:
> So I have an array of values:
>
> 30,10,20,30
>
> With an associated set of "classes" (1 through 4):
>
> 1,2,3,4
>
> I want to generate an output which gives me the CLASSES in rank order,
> keeping in mind that I don't care what happens with ties. So, for this
> example:
>
> 2,3,1,4 or 2,3,4,1 are ok.
>
> How do I do this in IDL?
>
> --j
>

IDL> rank = [30,10,20,30]
IDL> classes = [1, 2, 3, 4]
IDL> print,classes[sort(rank)]
2 3 1 4
[Message index]
 
Read Message
Previous Topic: Contour Problem
Next Topic: status of HDF5 *writing* support in IDL

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

Current Time: Sat Oct 11 12:24:57 PDT 2025

Total time taken to generate the page: 1.20160 seconds