MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   在matlab中加载变量 (https://www.labfans.com/bbs/showthread.php?t=26722)

poster 2019-12-14 20:46

在matlab中加载变量
 
我想以不同的图像名称在循环中加载变量。

for i=1:length(imagefile) name=imagefile{i}; % name=image01% load name end 它看起来是变量(名称)而不是变量(image01),我应该如何处理,



[B]回答:[/B]

不确定确切的变量是什么。字符串数组?

imaefgile = ["image01", "image02"] for i=1:length(imaefgile) load(imaefgile(i)) end PS,您可能还需要类似:

load(strcat("Folder/", imaefgile(i), ".mat")) 适当地连接文件名。



[url=https://stackoverflow.com/questions/5447764]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:15

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.