matlab中动态变量命名及赋值

可以采用eval函数,但应记得清除eval,即clear eval,如:
for i =1:9
A=random('Normal',0,1,100,3);
eval(['ratio',num2str(i),'= A']);
clear eval
end

Leave a Reply

Your email address will not be published. Required fields are marked *