From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Sorting 3D Data
Date: Thu, 19 Mar 2009 14:18:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 1
Message-ID: <gptk6q$4jp$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1237472282 4729 (19 Mar 2009 14:18:02 GMT)
NNTP-Posting-Date: Thu, 19 Mar 2009 14:18:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1677649
Xref: comp.soft-sys.matlab:526133

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.