B = reshape(A,m,n)
B = reshape(A,m,n) returns the m-by-n matrix B whose elements are taken columnwise from A. An error results if A does not have m*n elements.
A =1 4 7 102 5 8 113 6 9 12B = reshape(A,2,6)B =1 3 5 7 9 112 4 6 8 10 12
reshape is less cryptic. reshape uses the equivalent colon notation:
B = zeros(m,n);B(:) = A;
:,fliplr,flipud,rot90
(c) Copyright 1994 by The MathWorks, Inc.