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

Home » Public Forums » archive » Speedy way to get compare array elements. . .
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: Speedy way to get compare array elements. . . [message #33064 is a reply to message #32838] Mon, 25 November 2002 03:36 Go to previous message
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
Sean Raffuse wrote:
> Exalted newsgroup,
>
> What is the fastest way to compare two adjacent values in an array?
>
> Something like:
>
> whoa_huge_jump = where(A[i+1]-A[i] GT 500)
>
> Since this is IDL, I'm assuming I don't have to make a loop.
>
> Thanks,
>
> Sean


You might do it that way with
i=lindgen(n_elements(A)-1)
or have a look a the shift function which might be faster.
Even the convol function with a kernel of [-1,1] might be used here I
think.
Hope that helps,
marc
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: CW_FORM
Next Topic: CreateDrawWidget fails " Unable to acquire a GL context."

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

Current Time: Fri Oct 10 16:28:58 PDT 2025

Total time taken to generate the page: 0.39692 seconds