Path: news.mathworks.com!not-for-mail
From: "Chandra Varanasi" <chandravaranasi@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: ABout 'unique' command
Date: Tue, 20 Nov 2007 01:08:54 +0000 (UTC)
Organization: Seagate Technology LLC
Lines: 16
Message-ID: <fhtc36$lhk$1@fred.mathworks.com>
Reply-To: "Chandra Varanasi" <chandravaranasi@yahoo.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 1195520934 22068 172.30.248.37 (20 Nov 2007 01:08:54 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 20 Nov 2007 01:08:54 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 16412
Xref: news.mathworks.com comp.soft-sys.matlab:438445


'unique' command outputs the final occurrence of a 
repeating element. Is there a way to make it output the 
first occurence instead?

Thanks

Example:  A = [6 7 6 8 11 3 5 11];

[B, IA, IB] = unique(A) gives

B = [3 5 6 7 8 11]
IA = [6 7 3 2 4 8]
IB = [something]

I would like IA to display [6 7 1 2 4 5] instead