开发者

load a variable in matlab

I want to load variables in a loop with different imagenames.

for i=1:length(imagefile) 
      name=imagefile{i}; 
% name=image01% load name  
end

it looks variable (name) and no开发者_如何学编程t (image01), how should I do it regards,


Not sure exactly what your variable is. An array of strings?

imaefgile = ["image01", "image02"]
for i=1:length(imaefgile)
    load(imaefgile(i))
end

P.S. you may also need something like:

load(strcat("Folder/", imaefgile(i), ".mat"))

to concatenate the filename appropriately.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜