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

Home » Public Forums » archive » Re: Getting rid of loops
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: Getting rid of loops [message #18927 is a reply to message #18926] Fri, 18 February 2000 00:00 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
Jacob Noel-Storr <jake@astro.columbia.edu> wrote in message
news:88i60t$477$1@newsmaster.cc.columbia.edu...
> ..
> I have a very long list of integers ('cycle numbers') and I need some way
of
> creating an array that consists of just the cycle numbers. For example if
I
> had:
>
>> cycles=[2,2,2,2,2,6,6,7,7,7,9,9,9,27,27,27]
>
> then I would want a function which would do this kid of thing:
>
>> print,fn(cycles)
> [2,6,7,9,27]

The UNIQ function, along with the SORT function, will do this:

print, UNIQ(cycles, SORT(cycles))

or if you know that your array is already monotonic, just:

print, UNIQ(cycles)

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: How to do a weighted fit using pv-wave?
Next Topic: Re: TeXtoIDL fix for IDL 5.3

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

Current Time: Sat Oct 11 03:39:09 PDT 2025

Total time taken to generate the page: 1.83942 seconds