Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help: Finding 2nd max value index
Date: Fri, 11 Jan 2008 04:32:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <fm6rg2$jqp$1@fred.mathworks.com>
References: <fm5mba$glr$1@fred.mathworks.com> <30744347.1200023064740.JavaMail.jakarta@nitrogen.mathforum.org>
Reply-To: <HIDDEN>
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 1200025923 20313 172.30.248.37 (11 Jan 2008 04:32:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 11 Jan 2008 04:32:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 113206
Xref: news.mathworks.com comp.soft-sys.matlab:445296



Dan <dan_ang_25@yahoo.com> wrote in message 
<30744347.1200023064740.JavaMail.jakarta@nitrogen.mathforum.org>...
> :( ... i do not have maxnd function, is there any other 
way out? Thks Huy. or anywwhere i can download this 
function


Just copy and save the below code to a funtion file maxnd.m

function y = maxnd(x,n)
   [xu,ind] = unique(x);
   y = [xu(end-n+1) ind(end-n+1)];


Anh Huy Phan
RIKEN - BSI