Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: sorting array with re-occuring values
Date: Thu, 19 Feb 2009 00:29:02 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 27
Message-ID: <gni94e$g9$1@fred.mathworks.com>
References: <09fd2fcb-3a08-414a-872a-7578408ea0cf@g3g2000pre.googlegroups.com>
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 1235003342 521 172.30.248.37 (19 Feb 2009 00:29:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 19 Feb 2009 00:29:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: news.mathworks.com comp.soft-sys.matlab:519288

Michael <michael.j.krause@gmail.com> wrote in message <09fd2fcb-3a08-414a-872a-7578408ea0cf@g3g2000pre.googlegroups.com>...
> Suppose:
> 
> >> I=[3     7    10     8     4     5     9     5     8     2]
> 
> Does anyone know a quick solution how I can use "I" as an index (same
> number of elements as "I", first element is "1", and no re-occurring
> values)?
> 
> That array I want should be look like this:
> 
> >>iWant
>    = 2     6     10     7     3     4     9     5     8     1
> 
> Thanks a lot!
> 
> -Michael



I don't see the connection between I and iWant.  Especially when you say that the first element should be 1, then you show the first element as 2, and nothing looks sorted to me at all.  What exactly is the mapping you are after?





H[@f]`VR!HJff\fLWL4ffmVmOL,V[fI[PStHOHTfWIHUOVVNJPS'VL\HHTU