Simlify a function in matlab

조회 수: 3 (최근 30일)
Mtnkh
Mtnkh 2023년 1월 23일
댓글: Mtnkh 2023년 1월 24일
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
Benjamin Thompson
Benjamin Thompson 2023년 1월 23일
So you want to solve the equation for 'x'?
Mtnkh
Mtnkh 2023년 1월 24일
Yes!

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2023년 1월 23일
syms B C x
eqn = cos(x) + B*sin(x) == C
eqn = 
expr = -sin(x) + B*cos(x)
expr = 
xsol = solve(eqn,x)
xsol = 
newexpr = simplify(subs(expr, x, xsol))
newexpr = 

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numbers and Precision에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by