Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!64g2000hsw.googlegroups.com!not-for-mail
From: Ross <fed.rossi@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: I am sure matlab has a function for this...
Date: Wed, 20 Feb 2008 08:48:33 -0800 (PST)
Organization: http://groups.google.com
Lines: 26
Message-ID: <aae48257-c03b-4d23-8b59-54a57f4871f5@64g2000hsw.googlegroups.com>
References: <5641f3e2-ce50-49f3-bf58-b76fb1f0f59c@s37g2000prg.googlegroups.com> 
NNTP-Posting-Host: 165.124.163.197
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1203526114 18258 127.0.0.1 (20 Feb 2008 16:48:34 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 20 Feb 2008 16:48:34 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 64g2000hsw.googlegroups.com; posting-host=165.124.163.197; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.4) 
Xref: news.mathworks.com comp.soft-sys.matlab:452684


On Feb 20, 10:44 am, "Steven Lord" <sl...@mathworks.com> wrote:
> "Ross" <fed.ro...@gmail.com> wrote in message
>
> news:5641f3e2-ce50-49f3-bf58-b76fb1f0f59c@s37g2000prg.googlegroups.com...
>
> > Hi,
>
> > Sorry for the naive question:
>
> > Let V be a vector as follows:
>
> > P = [ 4 0 3 9 7 0]'
>
> > I would like to know how I can get (with the most efficient method)
>
> > f = [ 3 1 2 5 4 1]
>
> > i.e. the position of each element of P in unique(P);
>
> Look at the three-output syntax described in the M-file help for UNIQUE.
>
> --
> Steve Lord
> sl...@mathworks.com

steve, thanks!