Save mat file from MATLAB

后端 未结 1 1894
时光取名叫无心
时光取名叫无心 2020-12-07 06:09

I want to save variables in a loop with different image names, like

for i = 1:length(imagefile)
    name = imagefile{i};
    var = rand(100); % Just for exam         


        
相关标签:
1条回答
  • 2020-12-07 06:33

    Sayyad, you don't have to use eval. You can simply use the function form of save, i.e., save(filename,variables). This will use the value of filename. Remember that the variables need to be entered as strings. So, in your example, it would be

    save(name,'var')
    
    0 讨论(0)
提交回复
热议问题