load name im array
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Manuel
am 10 Jul. 2017
Beantwortet: Walter Roberson
am 10 Jul. 2017
Hello,
i have an issuse according to the load function.
load 'f(1)' % searches for a file called f(1)
what i want:
load the file named like the first entry in variable f
Thanks
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 10 Jul. 2017
load(f{1})
However, please remember that it is bad practice to "poof" variables into the workspace. It is better to assign the output of load() to a variable and access the components as needed:
f1struct = load(f{1});
x = f1struct.x; %now access the stored values
y = f1struct.y;
0 Kommentare
Weitere Antworten (1)
KSSV
am 10 Jul. 2017
Hoping your f is a cell array of names of the files in the folder..you may use.
load f{1}
1 Kommentar
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!