[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding all max/min of a graph

wmc@bas.ac.uk wrote:
> This may or may not be a FAQ but my rather feeble search failed to
> find it...
> I have a graph with about 10 (local) max/mins, I'd like to find them
> all, objectively. What do I do?

We had a lengthy debate concerning just this topic a few months ago.  The topic
was expanded to include n point extrema, but for the simple case of a point
either less than or greater than both of it's nearest neighbors, you could try:

wh=where(d ne median(d,3))


 J.D. Smith                             /*\    WORK: (607) 255-6263
 Cornell University Dept. of Astronomy  \*/	     (607) 255-5842
 304 Space Sciences Bldg.               /*\     FAX: (607) 255-5875  
 Ithaca, NY 14853                       \*/