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

Home » Public Forums » archive » Re: Array definition
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: Array definition [message #55275 is a reply to message #55273] Wed, 08 August 2007 10:18 Go to previous messageGo to previous message
yp is currently offline  yp
Messages: 42
Registered: February 2005
Member
On Aug 8, 6:00 pm, Melanie <mkjone...@gmail.com> wrote:
> Hi,
> I am trying to check an array of about 19000 elements for values that
> are above a certain value. I then want to save only the index of the
> larger values in a new array.

avoid FOR loop, use WHERE
indices = where(array GT value, n_wh)

>
> So, I am going through the original array with a for loop and checking
> if each value is greater than 19:
> for i=0, nelements-1 do begin
> if (array1[i] gt 19) then...
>
> Next, if the value in array1 is in fact greater than 19, I want to
> save the value of i into a new array such as
>
> if(array1[i] gt 19) then array2[...]=i
>
> But I'm not sure how to make this work such that I can write each
> subsequent i value for which the value in array1 is gt 19 into each
> subsequenbt space in array2...
>
> Any ideas? Please let me know if this question is not clear...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mac OS x IDL font handling
Next Topic: byte offset in POINT_LUN

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

Current Time: Sun Oct 12 04:37:55 PDT 2025

Total time taken to generate the page: 0.16137 seconds