MATLAB: Using Imagesc to displace 3D in 2D

image clicesimagesc

My original data matrix is of the size 1000x50x40. The program have generated data for each of the points within the matrix. I need to display the data using the imagesc command in either xy or xz plane only as slices.
May I gather some help on how to achieve that?

Best Answer

I recommend you use slice() instead of imagesc() for this purpose.
But if you must:
OutXYArray = YourArray(:,:, ZPlaneNumber);
imagesc(OutXYArray);
OutXZArray = squeeze( YourArray(:, YPLaneNumber, :) );
imagesc(OutXZArray);