load name im array
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2017-7-10
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 个评论
更多回答(1 个)
KSSV
2017-7-10
Hoping your f is a cell array of names of the files in the folder..you may use.
load f{1}
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!