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 Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by