Mostra commenti meno recenti
以下のような変数があります。
TEST = 'set';
A = 1;
この 'set' を変数名にしてAを代入することはできますか?
%何かやり方
A = 1;
set = A;
= 1
Risposta accettata
Più risposte (1)
madhan ravi
il 21 Feb 2019
I strongly don’t recommend using eval here in this situation ,https://www.mathworks.com/help/matlab/matlab_prog/generate-field-names-from-variables.html - refer this as a workaround.
A=1;
s.set=A;
s.('set')
Categorie
Scopri di più su プログラミング in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!