"Jerry " <jerrych...@gmail.com> wrote in message <k83jm3$4o...@newscl01ah.mathworks.com>...
> A=rand (201,7152);
> "A" is a matrix and I would like to reshape "A" to "B"
> B=reshape (A,59898,24);
> "B" is not going to be what I expected since it is getting mixed up. For example
> isequal(C, D)
> ans =
> How can I reshape "A" to get "C" equal with "D".
- - - - - - - - -
To get the kind of rearrangement you have in mind takes more than a simple 'reshape'. One has to do a little permuting first. Do this:
r = 298; % The number of your blocks
[p,t] = size(A); % p = 201, t = 7152
q = t/r; % t must be divisible by r, q = 24
s = 0:p*q*r-1;
B = reshape(A(1+s+p*((q-1)*floor(s/p)-(q*r-1)*floor(s/(p*r)))),p*r,q);