How to count how many sub folders under a folder
62 次查看(过去 30 天)
显示 更早的评论
In a folder, there are many sub folder, how do we count how many sub folder they are?
1 个评论
Stephen23
2016-3-4
编辑:Stephen23
2022-9-3
Note that KSSV's answer actually counts the total contents of a folder, including any files.
See also:
As Walter Roberson wrote in that last link: "In short: if your code assumes that '.' and '..' are the first two entries in a directory, your code has a bug (even in MS Windows). If your code assumes that directory entries are returned in any sorted order, your code has a bug (in all OS.)"
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!