how do I count number of folder?

41 vues (au cours des 30 derniers jours)
YJ
YJ le 7 Oct 2014
I do know how to count the number of files within the folder like this,
but is their way to file the number of folder inside the certain folder? (not file)
  1 commentaire
Oleg Komarov
Oleg Komarov le 7 Oct 2014
use dir()

Connectez-vous pour commenter.

Réponse acceptée

José-Luis
José-Luis le 7 Oct 2014
all_files = dir;
all_dir = all_files([all_files(:).isdir]);
num_dir = numel(all_dir);
  1 commentaire
YJ
YJ le 7 Oct 2014
thank you!!

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 8 Oct 2014

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by