Matlab将字符串改成变量名-eval

clc;clear
ii=1
p1 = [1 2;3 4]
str = ['p',num2str(ii)]
str2 = eval(str)
aaa = str2 + 5
whos

 

 

posted @ 2021-08-14 15:33  xdd1997  阅读(2915)  评论(0编辑  收藏  举报