Simplifying/gathering expression on known variables
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!