Prev: maples versus symbolic toolbox
Next: matrix in a matrix
From: IAN SAl on 14 May 2010 06:44 Hi everyone I have 3 dim. matrix and would change it into 2 dim one. for examples A1(:,:,1) = 1 2 3 4 5 6 A1(:,:,2) = 7 8 9 10 11 12 A1(:,:,3) = 13 14 15 16 17 18 I would sort them like each matrix under the one before in 2 dim matrix to be Anew = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 i have used this command Anew=[A1(:,:,1);A1(:,:,2);A1(:,:,3)] but i have huge No of matrices so its not a good idea to sort them by this command I have tried squeeze but i find , what i had used , is to deal with rows or something needs me to take long route to reach. Any helps would be greatly appreciates with considering that i have many huge matrices Regards IAN
From: us on 14 May 2010 07:03 "IAN SAl" <ib52(a)hotmail.com> wrote in message <hsj9hl$iit$1(a)fred.mathworks.com>... > Hi everyone > > I have 3 dim. matrix and would change it into 2 dim one. > > for examples > > A1(:,:,1) = > > 1 2 3 > 4 5 6 > > A1(:,:,2) = > > 7 8 9 > 10 11 12 > > A1(:,:,3) = > > 13 14 15 > 16 17 18 > > I would sort them like each matrix under the one before in 2 dim matrix to be > > Anew = > > 1 2 3 > 4 5 6 > 7 8 9 > 10 11 12 > 13 14 15 > 16 17 18 > > i have used this command Anew=[A1(:,:,1);A1(:,:,2);A1(:,:,3)] > > but i have huge No of matrices so its not a good idea to sort them by this command > > I have tried squeeze but i find , what i had used , is to deal with rows or something needs me to take long route to reach. > > > Any helps would be greatly appreciates with considering that i have many huge matrices > > Regards > IAN a hint: - this FEX submission does what you want... http://www.mathworks.com/matlabcentral/fileexchange/20255 % in essence % - it reshapes a ND1 -> ND2 row-col wise... ns=size(nd); nd=permute(nd,[1,3:numel(ns),2]); nd=reshape(nd,[],ns(2)); us
From: IAN SAl on 14 May 2010 09:32 Thanks US for help I don't know how to use it . Does it need some to be installed or there is a specific way to use it? Thanks IAN
From: us on 14 May 2010 10:36 "IAN SAl" <ib52(a)hotmail.com> wrote in message <hsjjck$jfl$1(a)fred.mathworks.com>... > Thanks US for help > > I don't know how to use it . Does it need some to be installed or there is a specific way to use it? > > Thanks > > IAN well... if you refer to the FEX submission - download it to a folder in your ML path (or working folder)... - use it... us
From: IAN SAl on 16 May 2010 16:16 Great help us Thanks very much IAN
|
Pages: 1 Prev: maples versus symbolic toolbox Next: matrix in a matrix |