Re: Multidimensional array to a matrix.



Yes Thanks.
Jesse Lai wrote:
I was curious about this. Try this code out. If the vector is AA

AA(:,:,1) =
1 2
3 4
AA(:,:,2) =
5 6
7 8

num_elements=size(AA);
reshape(permute(AA,[3 2 1]),[num_elements(3)
prod(num_elements(1:2))])

Then the result is
ans =
1 2 3 4
5 6 7 8

Is that what you were looking for?


.