Extracting variables from symbolic expression in a matrix form
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a long equation in symbolic math toolbox which has the following form:
A*u1+B*u2+C*u3
A, B and C are long relationships consisting of symbolic variables. I would like to extract the A B C in from u1, u2 and u3 and write them in a matrix form. In other words I would like to shape a relationship such us
[A B C]*{u}
where u is
u=[u1;u2;u3]
How can I do that?
0 commentaires
Réponse acceptée
Walter Roberson
le 29 Avr 2013
2 commentaires
Walter Roberson
le 29 Avr 2013
If you define k before you define h, then I think it might display in the shorter form.
syms h a b
k = c1*h +c2*h+c3*h;
h = a + b;
disp(k)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!