Help with Reshaping Multidimensional Arrays

I have Multidimensional Arrays, but I need of a reshaped matrix, indexing columns of each "dimension".
The number of arrays and number of rows can change according to the user, like that:
A (1:x, 1:3, 1:y) if x= 3 and y = 2
A(:,:,1)= [1 2 3
4 5 6
7 8 9];
A(:,:,2)= [10 11 12
13 13 15
16 17 18];
Matlab answer
B = Reshape (A,x*y,3)
B= [1 3 11
4 6 13
7 9 17
2 10 12
5 13 15
8 16 18];
I need the answer:
B= [1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18];
Thank for your help

 Accepted Answer

More Answers (0)

Products

Release

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!