<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694</link>
    <title>MATLAB Central Newsreader - position of the max value in a vector</title>
    <description>Feed for thread: position of the max value in a vector</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sun, 04 May 2008 11:50:05 -0400</pubDate>
      <title>position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430152</link>
      <author>lars Man</author>
      <description>Hi all,&lt;br&gt;
my problem is. I got a coulmn vector out of a calculation &lt;br&gt;
with about 10000 rows.&lt;br&gt;
Now i want to know WHERE the maximum value is.&lt;br&gt;
&lt;br&gt;
For example:&lt;br&gt;
v= [1; 2; 3; 4; 3; 8; 3];&lt;br&gt;
max(v)&lt;br&gt;
&lt;br&gt;
8&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
but how can I get the position from the max. Here for &lt;br&gt;
example it shoud be 6 (cause of the positon of the max &lt;br&gt;
value. It ist 6). &lt;br&gt;
But i don't know to get it.&lt;br&gt;
&lt;br&gt;
Thanks for help&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 04 May 2008 12:22:02 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430154</link>
      <author>Lars </author>
      <description>&amp;gt;&amp;gt; help find&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 04 May 2008 12:54:04 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430157</link>
      <author>John D'Errico</author>
      <description>"lars Man" &amp;lt;larsman@gmx.net&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fvk7td$ofp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt; my problem is. I got a coulmn vector out of a calculation &lt;br&gt;
&amp;gt; with about 10000 rows.&lt;br&gt;
&amp;gt; Now i want to know WHERE the maximum value is.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; For example:&lt;br&gt;
&amp;gt; v= [1; 2; 3; 4; 3; 8; 3];&lt;br&gt;
&amp;gt; max(v)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 8&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; but how can I get the position from the max. Here for &lt;br&gt;
&amp;gt; example it shoud be 6 (cause of the positon of the max &lt;br&gt;
&amp;gt; value. It ist 6). &lt;br&gt;
&amp;gt; But i don't know to get it.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks for help&lt;br&gt;
&lt;br&gt;
help max&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 04 May 2008 13:15:39 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430160</link>
      <author>dpb</author>
      <description>lars Man wrote:&lt;br&gt;
...&lt;br&gt;
&lt;br&gt;
&amp;gt; Now i want to know WHERE the maximum value is.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; For example:&lt;br&gt;
&amp;gt; v= [1; 2; 3; 4; 3; 8; 3];&lt;br&gt;
&amp;gt; max(v)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 8&lt;br&gt;
&lt;br&gt;
doc max&lt;br&gt;
&lt;br&gt;
--&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 04 May 2008 14:05:07 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430166</link>
      <author>Image Analyst</author>
      <description>"lars Man" &amp;lt;larsman@gmx.net&amp;gt; wrote in message &lt;br&gt;
&amp;lt;fvk7td$ofp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt; my problem is. I got a coulmn vector out of a calculation &lt;br&gt;
&amp;gt; with about 10000 rows.&lt;br&gt;
&amp;gt; Now i want to know WHERE the maximum value is.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; For example:&lt;br&gt;
&amp;gt; v= [1; 2; 3; 4; 3; 8; 3];&lt;br&gt;
&amp;gt; max(v)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 8&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; but how can I get the position from the max. Here for &lt;br&gt;
&amp;gt; example it shoud be 6 (cause of the positon of the max &lt;br&gt;
&amp;gt; value. It ist 6). &lt;br&gt;
&amp;gt; But i don't know to get it.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks for help&lt;br&gt;
&lt;br&gt;
---------------------------------------------------&lt;br&gt;
lars Man:&lt;br&gt;
How about something like:&lt;br&gt;
indexOfMaxValue = find(v==max(v));&lt;br&gt;
&lt;br&gt;
Regards,&lt;br&gt;
ImageAnalyst&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 04 May 2008 14:09:33 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430168</link>
      <author>dpb</author>
      <description>Image Analyst wrote:&lt;br&gt;
&amp;gt; "lars Man" &amp;lt;larsman@gmx.net&amp;gt; wrote in message &lt;br&gt;
...&lt;br&gt;
&amp;gt;&amp;gt; but how can I get the position from the max. &lt;br&gt;
...&lt;br&gt;
&amp;gt; How about something like:&lt;br&gt;
&amp;gt; indexOfMaxValue = find(v==max(v));&lt;br&gt;
&lt;br&gt;
or&lt;br&gt;
&lt;br&gt;
[vmax, idx] = max(v);&lt;br&gt;
&lt;br&gt;
:)&lt;br&gt;
&lt;br&gt;
(max() does return only the first of multiples whereas find() will &lt;br&gt;
return the vector, of course, if that is wanted/needed...)&lt;br&gt;
&lt;br&gt;
--&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 04 May 2008 17:52:21 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430190</link>
      <author>CandyGirl</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
If you want the index try:&lt;br&gt;
&lt;br&gt;
[maxval, maxind]=max(a)&lt;br&gt;
&lt;br&gt;
:)&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 05 May 2008 18:13:02 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430399</link>
      <author>aasim Azooz</author>
      <description>"Lars " &amp;lt;mustermann.klaus.TO.REMOVE@gmx.de&amp;gt; wrote in &lt;br&gt;
message &amp;lt;fvk9pa$9cv$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; help find&lt;br&gt;
use&lt;br&gt;
[x,i]=max(A)&lt;br&gt;
x is the maximum value of your vector&lt;br&gt;
i is the index of where the maximum value was found. for &lt;br&gt;
more information type&lt;br&gt;
&amp;gt;&amp;gt; help max&lt;br&gt;
&lt;br&gt;
Aasim Azooz&lt;br&gt;
Mosul University&lt;br&gt;
Mosul Iraq&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 06 May 2008 19:49:02 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430648</link>
      <author>lars Man</author>
      <description>Thanks a lot to all!!!!!&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 06 May 2008 19:49:03 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430649</link>
      <author>lars Man</author>
      <description>Thanks a lot to all!!!!!&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 06 May 2008 19:49:03 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430650</link>
      <author>lars Man</author>
      <description>Thanks a lot to all!!!!!&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 06 May 2008 19:50:20 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430651</link>
      <author>lars Man</author>
      <description>Thanks a lot to all!!!!!&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 06 May 2008 19:50:20 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430652</link>
      <author>lars Man</author>
      <description>Thanks a lot to all!!!!!&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 06 May 2008 19:50:20 -0400</pubDate>
      <title>Re: position of the max value in a vector</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/168694#430653</link>
      <author>lars Man</author>
      <description>Thanks a lot to all. It works!&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
