MATLAB: Reshape array 3 variables into 2

arrayreshape

Hi,
I have an array of A=1x100x50.
How can I reshape it in B=100×50?
I have tried with
B=reshape(A,[100, 50]);
But I get the error message
Error using reshape To RESHAPE the number of elements must not change.
Thanks in advance for your reply.

Best Answer

B = squeeze(A)
or
B = permute(A,[2,3,1]);
or
B = reshape(A,size(A,2),[]);