open subfolders within a folder

Hi,
I'm trying to write a program that opens subfolders sequentially within a folder and applies a function to files within each subfolder. Any ideas?

 采纳的回答

Image Analyst
Image Analyst 2013-12-17

0 个投票

See my demo, attached below in blue.

5 个评论

That's perfect...thankyou!
Please mark the answer as Accepted then. Thanks.
This script does not properly separate the subfolders. After copying, pasting, and running, this returned one long string of my 5 subfolders and stated that there was one folder. Perhaps the delimiter is different?
@Olivia, with the new behaviour of dir introduced a few versions ago, listing all the subfolders is now trivial. See the example
It does work to go into each sub folder one at a time. Not sure what you meant by "does not properly separate the subfolders". But like Guillaume said, there is a new version and I attach a demo for that.

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by