Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
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 Kommentare
Rik
Rik am 12 Mai 2020
Using dir with a double asterisk should do the trick. Do you want to find all mat files in your folders?
new2matlab
new2matlab am 12 Mai 2020
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 12 Mai 2020
a=dir('**/Data*.mat')

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by