MATLAB: How to count how many sub folders under a folder

count

In a folder, there are many sub folder, how do we count how many sub folder they are?

Best Answer

go the folder...and use
k = dir ;
N = length(k)-2 ;
N should be the number of sub folders.