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

Home » Public Forums » archive » Re: Ordered index array
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: Ordered index array [message #45420 is a reply to message #45419] Thu, 08 September 2005 06:51 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
David Fanning wrote:
> Paolo Grigis writes:
>
> [...]
>
> Humm. Maybe I'm missing something (I haven't had my coffee yet),
> but couldn't this be solved with the original code I wrote by
> changing these two lines:
>
> ; Create index array and output array.
> b = Indgen(N_Elements(a))+ 1
> c = Intarr(N_Elements(a))
>
> To these:
>
> ; Create index array and output array.
> b = Indgen(N_Elements(a) > N_Elements(h)) + 1
> c = Intarr(N_Elements(a) > N_Elements(h))
>
> Then,
>
> IDL> a=[3,3,1,2,3,2,2,1,2,3]
> IDL> Print, a
> 1 1 3 4 1 4 4 3 4 1

Well, I guess this depends on whether the original poster minds having
gaps in the "rankings" (no element with "rank" 2 in your example)...

Ciao,
Paolo


>
> Cheers,
>
> David
>
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 2 arrays, average, missing data
Next Topic: Re: 2 arrays, average, missing data

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

Current Time: Fri Oct 10 05:10:47 PDT 2025

Total time taken to generate the page: 0.31962 seconds