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

Home » Public Forums » archive » vectorising versus 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: vectorising versus loops [message #38217 is a reply to message #38146] Mon, 23 February 2004 16:04 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
nasalmon@onetel.net.uk (Neil) writes:
> Craig,
>
> yes many thanks for this valuable information. One of the problems i
> have is that the condition in the WHERE statement has to contain the
> counter in the "do loop", that is basically why i put it in the "do
> loop" to start with. Is there any way i can make the condition depend
> on the counter, ie the vector index.

Yes, you can make a vector of index values with LINDGEN,

;; Make a list of indices
ii = lindgen(n_elements(x))

;; Select on X and the index variable
wh = where(x GE 0 AND ii LT 200)

Good luck,
Craig
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: resizing image
Next Topic: IDL jobs anyone?

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

Current Time: Sat Oct 11 13:43:18 PDT 2025

Total time taken to generate the page: 0.79701 seconds