how do I count number of folder?

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)

 Réponse acceptée

José-Luis
José-Luis le 7 Oct 2014

0 votes

all_files = dir;
all_dir = all_files([all_files(:).isdir]);
num_dir = numel(all_dir);

Catégories

En savoir plus sur File Operations dans Centre d'aide 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