MATLAB: Prevent Overwrite Image in loop

for loopimread

I am trying to load all 16 images. When I run my code now, Only the last image is saved and can be displayed. Even when I include "loadedimage= imread(Image)" and "imshow(loadedimage)" in the for loop this still occurs. Thanks for any help!
for k=1:16 fileName = strcat('image',num2str(k),'.bmp'); Image= char(fileName); end loadedimage= imread(Image); imshow(loadedimage)

Best Answer

N = 16;
C = cell(1,N);
for k = 1:N
F = sprintf('image%d.bmp',k);
C{k} = imread(F);
end
All of the images will be in cell array C.