how do I make first name of my struct variable?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello all, I'm trying to make the first name of my struct variable but I can't figure out how to do it.
This works
test.a = 1;
List = 'a';
test.(List)
ans = 1
I'm trying to do the following:
test.a = 1;
List = 'test'
(List).a
%now I want to get the output test.a but I get:
(List).a
|
Error: Unexpected MATLAB operator.
Is it possible what im trying to do and if so how?
regards, Nick
댓글 수: 2
Friedrich
2013년 8월 6일
Why do you need this? This doesn't seem like a good way of programming. Maybe if you explain why you need this, we can help you with a better more suitable way of achieving your goal?
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!