MATLAB: Concatenate a 10x4x40 Double Matrix to 40×4

catconcatenatevertcat

Hello,
I have a matrix A() that is 10x4x40. I would only like the first row of the matrix A(1,:,:) but want to vertically concatenate the data so it transforms into B() that is 40×4. How would I do this?
Right now I have tried doing
vertcat(A(:,:))
which returns a concatenated matrix of 1×160. Do I need to use a loop to do this? Please help!
Thank you

Best Answer

A=rand(10,4,40)
B=permute(A(1,:,:),[2 1 3])
out=B(:,:)'