Simlify a function in matlab
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi,
there is an equation:
cos(x) + B*sin(x) = C
and also an expression:
-sin(x) + B*cos(x)
I want to know if we can rewirte the expression in a way to omit "x". I could't do it manually. I wanted to know if there is any way in Matlab.
Thanks
댓글 수: 2
채택된 답변
Walter Roberson
2023년 1월 23일
syms B C x
eqn = cos(x) + B*sin(x) == C
expr = -sin(x) + B*cos(x)
xsol = solve(eqn,x)
newexpr = simplify(subs(expr, x, xsol))
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!