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

Home » Public Forums » archive » what is the highest subscript in the 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: what is the highest subscript in the array?!? [message #70860 is a reply to message #70774] Fri, 07 May 2010 03:20 Go to previous messageGo to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On May 6, 10:12 pm, munka <mynameismu...@gmail.com> wrote:

> It's irrelevant, but here is where I most recently used this.  This
> finds the local maximum in an array.
>         index=where(flux eq max(flux) and flux ne flux[0] and flux ne
> flux[n_elements(flux)-1],ct)
>

Not relevant to your main question, but if you care about speed and
have more than 2 elements than it is faster to write (not tested)

dum = max(flux[1:N_elements(flux)-1], c) & index = c+1

--Wayne
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Plotting 3D array as a 'cloud'
Next Topic: Re: Begin-End matching in IDLDE?

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

Current Time: Wed Oct 08 20:05:41 PDT 2025

Total time taken to generate the page: 0.40642 seconds