MATLAB: Display multiple image in one figure window using for loop

displayimage

my image database folder has images named 1.bmp,2.bmp..and so on i want to use for loop (1 to 5) and display five images in one window how to do it?

Best Answer

for K = 1 : 5
this_image = imread( sprintf('%d.bmp', K) );
ax = subplot(1, 5, K);
imshow(this_image, 'Parent', ax);
end