Simplifying/gathering expression on known variables
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!