how to display sub images which is stored in folder without overlapping?

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

1 Comment

doc subplot
will do that, especially if you are happy to have such a relatively large amount of space around the images. Otherwise you can create the axes yourself, creating a mathematically defined grid to populate their positions.

Sign in to comment.

 Accepted 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

5 Comments

thank you sir for reply but here i am getting an error of index exceeds matrix dimension".how to resolve this issue?
How many images are there in the folder? I have made few changes in the code....run that now...
there are 64 images in a folder which have to be displayed in single figure window of 8 x 8 grid without overlapping and in proper series order
so please suggest code how i can read this folder to matlab and subplot images
The code given does the same as you said.

Sign in to comment.

More Answers (1)

Categories

Find more on App Building in Help Center and File Exchange

Tags

Asked:

on 10 Apr 2018

Answered:

on 12 Apr 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!