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 件のコメント

anna
anna 2013 年 12 月 18 日
That's perfect...thankyou!
Image Analyst
Image Analyst 2013 年 12 月 18 日
Please mark the answer as Accepted then. Thanks.
Olivia Licata
Olivia Licata 2018 年 3 月 14 日
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?
Guillaume
Guillaume 2018 年 3 月 14 日
@Olivia, with the new behaviour of dir introduced a few versions ago, listing all the subfolders is now trivial. See the example
Image Analyst
Image Analyst 2018 年 3 月 15 日
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 ExchangeFile Operations についてさらに検索

質問済み:

2013 年 12 月 17 日

コメント済み:

2018 年 3 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by