Simplifying/gathering expression on known variables
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to do some analytical math with matlab using the symbolic toolbox, and at the end gather/simplifying the result using the known variables and expressions I have.
As an example to show what I want to do (this is just an example, not my actual code):
syms x1 x2 a b c x3 x2 = x3+cos(x1)*b; t = a*b*x1 + 30 + b + c*x2; %t will now be: b + c*(x3 + b*cos(x1)) + a*b*x1 + 30
My question is: How can I simplify this expression again to get back the inital expression a*b*x1 + 30 + b + c*x2 ? In other words, how can I make matlab replace x3+cos(x1)*b by x2 again? I have tried the simplify and collect functions, but they do not replace x3+cos(x1)*b by x2.
-Ivar
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox 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!