Calling variables instead of values
조회 수: 2 (최근 30일)
이전 댓글 표시
I have this:
A=1; B=2; C=3;
x = [2 3 1]
I want to call x1 as:
x1 =
B C A
I can call individual values, but I don't know how to call them as variables.
댓글 수: 0
채택된 답변
Andrei Bobrov
2011년 10월 31일
xc = num2cell(x)
[B C A]= xc{:}
ADD
x = [2 3 1]
xc = {'A' 'B' 'C'}
x1 = xc(x)
댓글 수: 2
Jan
2011년 10월 31일
@Will: What does "[B C A]" exactly mean? Is it a cell string, a string or a symbolic expression?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!