How to extract a string name from a cell array and use it as name for a new variable?
조회 수: 1 (최근 30일)
이전 댓글 표시
I want to make matlab use a string which was previously saved in a cell array for the construction of a new variable name...how can I do this?
eg.
A={'wind force', 'temperature', 'humidity'}
%define a new variable temperature
temperature=input('temperature', 's')
댓글 수: 0
답변 (1개)
Wayne King
2012년 6월 10일
Are you sure you want them to input the temperature as a string?
A={'wind force', 'temperature', 'humidity'};
temperature = input(A{2});
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!