find total number of images in a folder

247 visualizzazioni (ultimi 30 giorni)
how to find total number of images in a folder through coding....

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 2 Mar 2013
Modificato: Azzi Abdelmalek il 2 Mar 2013
a=dir([yourfolder '/*.jpg'])
out=size(a,1)

Più risposte (1)

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

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by