how to put path of a folder in a loop so the loop can open subfolders by itself
조회 수: 3 (최근 30일)
이전 댓글 표시
I have a folder which contains 38 subfolders and i need a for loop to open the base folder and open the subfolders and do some operations on the files in it. name of subfolders are AEMI8_1, AEMI8_2 ,..... does anyone have a solution? I use path and dir() but i don't know anything further.
댓글 수: 0
답변 (1개)
Githin George
2022년 7월 21일
편집: Githin George
2022년 7월 22일
Hi Souzan,
My understanding is that you need to enter into the subfolders one by one, do certain operations and exit from the subfolder and continue the process.
You can try using usthe cd command in matlab to get into the subfolders. For more info you can take a look at the doc here.
You can use a for loop to get into the subfolders iteratively, since the names are in a sequence.
댓글 수: 0
참고 항목
카테고리
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!