MATLAB: How to change M*1*N matrix to M*N matrix

imagescmatrix

I have a signal M*K*N matrix , and I want to display an slice of signal in xz plane something like: imagesc(a( : , 1, : )) but a( : , 1, : ) is considered as 3 dimensional matrix and can not be shown and always this message appears :
imagesc(abs(a(:,1,:)))
??? Error using ==> image
Error using ==> image
Indexed CData must be size [MxN], TrueColor CData must be size [MxNx3]
Error in ==> imagesc at 19 hh = image(varargin{1},'CDataMapping','scaled');
how can change this 3d matrix to a 2d with M*N?

Best Answer

permute(a,[1 3 2])