How do I load in multiple datasets from multiple folders?
Afficher commentaires plus anciens
I have run into a problem with my code where I need to load multiple .DAT files from multiple files that are deeply embeded in one another. For example, I have a main folder I need to access that has multiple folders inside of it, then I need to access this sub file which has multiple folders in it. Following this path is where the .dat files are located: 3D\amplitude\0 Amps\Static_Hysteresis however there are multiple "# Amps" files I need to access and get the .dat files out of all with the static hystresis file inside. I have attached a code to show how far I've gotten, however I am relatively new to matlab and therefore inexperienced.

Réponses (1)
Example:
folder = 'absolute\or\relative\path\to\folder\3D\amplitude';
dir_str = fullfile(folder,'*Amps','Static_Hysteresis','*.dat')
Then dir(dir_str) will return information about any .dat file located in a folder called "Static_Hysteresis", which is located in a folder whose name ends with "Amps", which is located directly in "\3D\amplitude". This seems to be what you are trying to do.
Catégories
En savoir plus sur File Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!