variable to output name
이전 댓글 표시
name = 'adams'
c = 2x+4
I would like the value of "name" to be the variable for c. Therefore, instead of:
c = 2x+4
it would be:
adams = 2x+4
댓글 수: 5
Azzi Abdelmalek
2013년 11월 1일
Can you explain?
Leyon
2013년 11월 1일
dpb
2013년 11월 1일
Don't do this, use dynamic field names instead...
Leyon
2013년 11월 1일
It isn't the only option, but I recommended it to you here
as the safest one. There are dangers in using assignin, eval, load, etc... to create variables inexplicitly. See, for example,
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Variables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!