Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how sort elements in an array in desired fashion
Date: Thu, 20 Dec 2012 09:37:08 +0000 (UTC)
Organization: Xoran Technologies
Lines: 8
Message-ID: <kaum84$5j9$1@newscl01ah.mathworks.com>
References: <kaukle$g5$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1355996228 5737 172.30.248.47 (20 Dec 2012 09:37:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 20 Dec 2012 09:37:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:785123

"sathish kumar" <satty634@gmail.com> wrote in message <kaukle$g5$1@newscl01ah.mathworks.com>...
> i have a array of elements A=(1 2 3 4 5 6)
> i know ascending mode ,and descending mode by   sort(A,mode)
> but i want the array in my require fashion i.e,(6 5 3 2 4 1)
> how to get above fashion from array A
> please tell me how to do it in matlab

A([6 5 3 2 4 1])