find total number of images in a folder

167 次查看(过去 30 天)
how to find total number of images in a folder through coding....

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-3-2
编辑:Azzi Abdelmalek 2013-3-2
a=dir([yourfolder '/*.jpg'])
out=size(a,1)

更多回答(1 个)

Mritula C
Mritula C 2018-12-17
Thanks,
a=dir([yourfolder '/*.jpg'])
This worked fine!!
  2 个评论
Saurabh Sharma
Saurabh Sharma 2019-8-11
What did you write in place of "yourfolder" ?
Walter Roberson
Walter Roberson 2019-8-12
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'));

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Modify Image Colors 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by