[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Where is the largest point ?
- Subject: Re: Where is the largest point ?
- From: Ben Tupper <btupper(at)bigelow.org>
- Date: Wed, 08 Aug 2001 16:13:43 -0400
- Newsgroups: comp.lang.idl-pvwave
- Organization: Bigelow Laboratory for Ocean Sciences
- References: <3b719b88@news.ColoState.EDU>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:26084
Hi,
Take a peek at the MAX function (check the online help)
maxVal = Max(Arrat, maxIndex)
maxVal will return the maximum value
maxIndex will return the index of the maximum value within the array.
If there is more than one value qualifying as MAX, then only the index
of the first maxVal encountered is returned in maxIndex.
Ben
Guillaume Dargaud wrote:
>
> I'm still pretty basic at IDL and a lot of the _no loop_ concepts escape me
> entirely (I'm too used to C and such).
> If I have a 2D matrix, how do I find where is the maximum ?
> Say:
>
> Mat=FltArr(NbX, NbY)
> ...
> [Xmax, YMax] = Where( Mat eq Max(Mat) )
>
> or something like that ?
> --
> Guillaume Dargaud
> Colorado State University - Dept of Atmospheric Science
> http://rome.atmos.colostate.edu/
> "If those folks in Kansas are right about evolution never having happened,
> I sure hope it happens soon." - Michael Sheinbaum.
--
Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd.
W. Boothbay Harbor, ME 04575
btupper@bigelow.org