MATLAB 字符串转换成变量名 1. eval:把字符串当命令来执行 例子: >> NameSource=[10 20 30]; for i=1:3 Name=['VarName',num2str(i)]; eval([Name,'=NameSource(i)']) end; VarName1 = 10 VarName2 = 20 VarName3 = 30