変数の作成について
이전 댓글 표시
以下のような変数があります。
TEST = 'set';
A = 1;
この 'set' を変数名にしてAを代入することはできますか?
%何かやり方
A = 1;
set = A;
= 1
채택된 답변
추가 답변 (1개)
madhan ravi
2019년 2월 21일
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')
카테고리
도움말 센터 및 File Exchange에서 プログラミング에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!