Calling variables instead of values
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Andrei Bobrov
le 31 Oct 2011
xc = num2cell(x)
[B C A]= xc{:}
ADD
x = [2 3 1]
xc = {'A' 'B' 'C'}
x1 = xc(x)
2 commentaires
Jan
le 31 Oct 2011
@Will: What does "[B C A]" exactly mean? Is it a cell string, a string or a symbolic expression?
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Large Files and Big Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!