作者Achui (Eagle)
看板MATLAB
標題[問題] Input 一個字串之後要把它當成矩陣的名字
時間Thu Nov 14 23:41:43 2013
Input 一個字串之後要把它當成矩陣的名字的作法?
ex:
>> x = input('please input a string:','s')
please input a string: AAA
x=AAA
但之後我想要指定AAA=[1,2,3]
要怎麼做呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.80.215
推 profyang:eval([x,'=[1,2,3]']) 11/14 23:44
→ Achui:解決了,謝謝1F的協助^^ 11/15 00:24