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!