MATLAB: How to display sub images which is stored in folder without overlapping

subimages

my subimages and output how it should look like is attached.kindly suggest code.because later on each and every segment i have to do modification.
any help is appreciated

Best Answer

images = dir('*.png') ;
N = length(images) ;
nx = 8 ; ny = 8 ; % number of plots along row and column
if nx*ny ~= N
error('Please change the order');
end
figure
count = 0 ;
for i = 1:nx
for j = 1:ny
count = count+1 ;
subplot(8,8,count) ;
imshow(imread(images(count).name))
axis off
end
end