Path: news.mathworks.com!not-for-mail
From: "Anh Huy Phan" <phananhhuy@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help: Finding 2nd max value index
Date: Thu, 10 Jan 2008 15:35:09 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <fm5dvd$5u9$1@fred.mathworks.com>
References: <16223830.1199960323818.JavaMail.jakarta@nitrogen.mathforum.org> <2717819.1199978159764.JavaMail.jakarta@nitrogen.mathforum.org>
Reply-To: "Anh Huy Phan" <phananhhuy@mathworks.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1199979309 6089 172.30.248.37 (10 Jan 2008 15:35:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 10 Jan 2008 15:35:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 113206
Xref: news.mathworks.com comp.soft-sys.matlab:445215


Dan <dan_ang_25@yahoo.com> wrote in message 
<2717819.1199978159764.JavaMail.jakarta@nitrogen.mathforum.org>...
> Thks Huy & Clarkson alot. A bow to you all. 
> 
> i have acheived and understand it. And spending time to 
solve my codes. I learnt something new today.
> 
> 
> Anyway, one last question is there any ways i can 
identify the 2nd max value, which column is it taken from. 
Eg. its from column 1, 2 , 3 ,4 or 5.


Suppose that you want to find the 2nd max value in the 
column 1, 3 and 4 

  arrayfun(@(i) maxnd(a(:,i),2),[1 3 4])


Anh Huy Phan
RIKEN - BSI