Search through folders and subfolders to collect data saved as a certain name

조회 수: 4 (최근 30일)
new2matlab
new2matlab 2020년 5월 12일
댓글: new2matlab 2020년 5월 12일
I've read documentation on different sectionf of this problem but I don't quite understand how to structure the script to search through dubfolders to pull out a .mat saved under a certain name "Data01.mat", "Data02.mat". I'll be taking this script to also save in the same folder with a slightly different name as well.
  댓글 수: 2
Rik
Rik 2020년 5월 12일
Using dir with a double asterisk should do the trick. Do you want to find all mat files in your folders?
new2matlab
new2matlab 2020년 5월 12일
Im looking to pull specific ones but they're spread out between different folders within a folder. Unsure on how to search through those different levels of folders all at the same time.

댓글을 달려면 로그인하십시오.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 5월 12일
a=dir('**/Data*.mat')

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by