find total number of images in a folder
168 views (last 30 days)
Show older comments
Elysi Cochin
on 2 Mar 2013
Commented: Walter Roberson
on 12 Aug 2019
how to find total number of images in a folder through coding....
0 Comments
Accepted Answer
Azzi Abdelmalek
on 2 Mar 2013
Edited: Azzi Abdelmalek
on 2 Mar 2013
a=dir([yourfolder '/*.jpg'])
out=size(a,1)
1 Comment
More Answers (1)
Mritula C
on 17 Dec 2018
Thanks,
a=dir([yourfolder '/*.jpg'])
This worked fine!!
2 Comments
Walter Roberson
on 12 Aug 2019
The folder name that you wanted to find the images of.
We recommend using fullfile() instead of the code there:
yourfolder = 'C:\Students\CS907\Assignment3\BananaPictures';
a = dir(fullfile(yourfolder, '*.jpg'));
See Also
Categories
Find more on Modify Image Colors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!