From: mobileT83 T on 21 May 2010 06:38 This worked perfectlly!!! I just had trouble testing it. Is there any way I could get vectors M and N returned in the correct order corresponding to 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] L is what was returned by a = reshape(A,[],L); "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: Gain Scheduling Controller Next: Date settings in Matlab and Access |