Transferring .mat files to workspace
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Vasyl Svystun
am 14 Jan. 2019
Bearbeitet: Vasyl Svystun
am 14 Jan. 2019
Hi,
I need a help with 1 question. I have 400 .mat files(Scope_Data). I must transfer them all to workspace. Can someone help Me?
0 Kommentare
Akzeptierte Antwort
TADA
am 14 Jan. 2019
Use dir Function To Loop Through All The Files And Load Them
fileList = dir('Your_path_goes_here');
data = cell();
for fi = length(fileList):-1:1
file = fileList(fi);
if file.isdir
continue;
end
data{fi} = load(fullfile(file.folder, file.name));
end
Now You Can Do Whatever You Want With The Data.
*If All Files Contain The same Varriables, You Can Load It Into Struct Array Instead Of Cell Array, And It Would Be More Convenient To Work With
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Whos 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!