Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]()
我想以不同的图像名称在循环中加载变量。
for i=1:length(imagefile) name=imagefile{i}; % name=image01% load name end 它看起来是变量(名称)而不是变量(image01),我应该如何处理, 回答: 不确定确切的变量是什么。字符串数组? imaefgile = ["image01", "image02"] for i=1:length(imaefgile) load(imaefgile(i)) end PS,您可能还需要类似: load(strcat("Folder/", imaefgile(i), ".mat")) 适当地连接文件名。 更多&回答... |
![]() |
![]() |