MATLAB: Extracting a 2 dimensional array from a 3 dimensional matrix.

MATLABmatrix

I have a 3D matrix named SM of order 17x10x181. I need to extract a 2D matrix from SM of order 10×181. What should be the command?

Best Answer

squeeze(SM(5,:,:))
For example. Without the squeeze it would be a 1 x 10 x 181 and the squeeze makes it 10 x 181