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 Exchange에서 File 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