MATLAB: How to show 20 images in single figure using matlab

replicating image to make 3d image

I have 20 images and I want to show them in single figure in a single axes . I am very new to matlab and I have to get this thing done by tomorrow and so I don't have time to learn to do that. I basically want to ask is when a single image is displayed it is shown with x and y axis (two directions) and if I rotate the figure using 'Rotate 3D' button , I am able to see that this image is occupying z = 0 plane . What I want is that I can display 20 images , on different xy planes , like image1 on z = 0 plane , image2 on z = 1 plane and so on … How to achieve this please help me out.

Best Answer

You can create a single 3D volumetric image like you said (same image at different z levels) using cat():
image3D = cat(3, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1);
To display them, you can use slice() to take cutaway views, or extract slices parallel to the x, y, or z axes.