Path: news.mathworks.com!not-for-mail
From: "Image Analyst" <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: position of the max value in a vector
Date: Sun, 4 May 2008 14:05:07 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <fvkfqi$3bu$1@fred.mathworks.com>
References: <fvk7td$ofp$1@fred.mathworks.com>
Reply-To: "Image Analyst" <imageanalyst@mailinator.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1209909907 3454 172.30.248.35 (4 May 2008 14:05:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 4 May 2008 14:05:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1343420
Xref: news.mathworks.com comp.soft-sys.matlab:466512


"lars Man" <larsman@gmx.net> wrote in message 
<fvk7td$ofp$1@fred.mathworks.com>...
> Hi all,
> my problem is. I got a coulmn vector out of a calculation 
> with about 10000 rows.
> Now i want to know WHERE the maximum value is.
> 
> For example:
> v= [1; 2; 3; 4; 3; 8; 3];
> max(v)
> 
> 8
> 
> 
> but how can I get the position from the max. Here for 
> example it shoud be 6 (cause of the positon of the max 
> value. It ist 6). 
> But i don't know to get it.
> 
> Thanks for help

---------------------------------------------------
lars Man:
How about something like:
indexOfMaxValue = find(v==max(v));

Regards,
ImageAnalyst