Say I have two arrays:
if true % code
count = 1;for m = 1:3for n = 1:3for k = 1:3A(count) = count;count = count + 1;endendendendif true % codecount = 1;for m = 1:3for n = 1:3for k = 1:3B(m,n,k) = count;count = count + 1;endendendend
Now, if I reshape B into a column vector (using B = B(:)), the order of the elements is different from A although the elements are the same.
Is there a way I can reshape B so that it is equal to A?
Thanks!
Best Answer