Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Sort and revert
Date: Thu, 13 Nov 2008 06:33:02 +0000 (UTC)
Organization: UTSA
Lines: 17
Message-ID: <gfghmu$bpo$1@fred.mathworks.com>
References: <195e56e8-c7b9-49b3-839f-fd0468067e86@35g2000pry.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 1226557982 12088 172.30.248.37 (13 Nov 2008 06:33:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 13 Nov 2008 06:33:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1332985
Xref: news.mathworks.com comp.soft-sys.matlab:500563


fas <faisalmufti@gmail.com> wrote in message <195e56e8-c7b9-49b3-839f-fd0468067e86@35g2000pry.googlegroups.com>...
> Hi,
> I have a vector which I have sorted B=sort(A); Now after changing the
> 10 values on either end I would like to take the vector back to A.
> B=sort(A);
> B(1:10)=20;
> B(90:100)=70;
> Now I want to transform B->A so that the indexing is same of what my A
> was.
> 
> Since its an image I have to revert back to same indexing of vector
> only with changed values that I did after sorting.
> 
> Any idea ?
That's easy. Try help sub2ind first, after you sorted and changed the vector, try help ind2sub.
May it helps.