find total number of images in a folder

103 ビュー (過去 30 日間)
Elysi Cochin
Elysi Cochin 2013 年 3 月 2 日
コメント済み: Walter Roberson 2019 年 8 月 12 日
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 件のコメント
Walter Roberson
Walter Roberson 2013 年 3 月 2 日
or
a = dir('*.jpeg');
n = numel(a);

サインインしてコメントする。

その他の回答 (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 Center および File ExchangeModify Image Colors についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by