Prev: Problem
Next: voice recognition, matlab coding
From: mobileT83 T on 20 May 2010 21:28 Thank you for the advice, I understand what you are saying, I really need a table... and they would have values corresponding to the values in each M, N, and L dimensions. Basically I need to take all of M and lay them out like below... in this case they go 1 through 4 and repeat, N on the other hand only changes when a new set of M starts and finally L is a 2d matrix M*NxL. this is the new set of matrices I want to make from the 3d matrix... M and N are indexing L. M N L 1 1 [random values] 2 1 [random values] 3 1 [random values] 4 1 [random values] 1 2 [random values] 2 2 [random values] 3 2 [random values] 4 2 [random values] "Matt Fig" <spamanon(a)yahoo.com> wrote in message <ht3u7u$2u2$1(a)fred.mathworks.com>... > Perhaps > > permute(A,[2 1 3]) > > will do what you need. "Roger Stafford" <ellieandrogerxyzzy(a)mindspring.com.invalid> wrote in message <ht3tfb$aqm$1(a)fred.mathworks.com>... > "mobileT83 T" <mobileT83(a)gmail.com> wrote in message <ht3mle$9re$1(a)fred.mathworks.com>... > > I would like to take a MxNxL matrix and get a M*NxL matrix. I know I can do this with two for loops > > > > A = MxNxL > > for ii = 1:N > > for jj = 1:M > > > > a = A(jj,ii,:); > > > > end > > end > > > > but I was hoping to you a reshape tool. And I want to keep the order given in this for loop. > > > > I found this but I don't know if it will help me... maybe I don't get it. > > http://www.mathworks.com/matlabcentral/fileexchange/20255 > > > > Thanks > > > > mobile > > Do: > > a = reshape(A,[],L); > > It is incompatible with the very notion of an M*N by L matrix to have the ordering you give from your for-loops. If I interpret your for-loop correctly, each set of L entries occurs in the most rapid ordering sequence, followed by the M and then the N entries. An M*N by L array doesn't work this way. > > Roger Stafford
|
Pages: 1 Prev: Problem Next: voice recognition, matlab coding |