how do I count number of folder?

67 views (last 30 days)
YJ
YJ on 7 Oct 2014
Answered: Image Analyst on 8 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)

Accepted Answer

José-Luis
José-Luis on 7 Oct 2014
all_files = dir;
all_dir = all_files([all_files(:).isdir]);
num_dir = numel(all_dir);

More Answers (1)

Image Analyst
Image Analyst on 8 Oct 2014

Categories

Find more on File Operations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!