Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Sorting 3D Data
Date: Thu, 19 Mar 2009 14:59:01 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 7
Message-ID: <gptmjl$ofq$1@fred.mathworks.com>
References: <gptk6q$4jp$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1237474741 25082 172.30.248.38 (19 Mar 2009 14:59:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 19 Mar 2009 14:59:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:526156

"Medha Jani" <medha_jani@yahoo.com> wrote in message <gptk6q$4jp$1@fred.mathworks.com>...
> I have my data as a 3d matrix A(150x120x240) or A(i,j,k) containing positional coordinates x,y,z of an object. Here, the element A(1,1,1) contains the x-,y- and z-coordinates of an object. I want to sort this data, but there is one problem. I cannot use the sort functions as that would lead to complete rearrangement of coordinates and the corresponding positions of x,y and z would be lost. Can anyone suggest a way that I can sort this data according to either the first dimension or second dimension or third dimension, but the corresponding other two dimensions must also change with it and the positional coordinates are not lost.

help sortrows

HTH,
John