Simlify a function in matlab

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 comentarios

Benjamin Thompson
Benjamin Thompson el 23 de En. de 2023
So you want to solve the equation for 'x'?
Mtnkh
Mtnkh el 24 de En. de 2023
Yes!

Iniciar sesión para comentar.

 Respuesta aceptada

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 = 

Más respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 23 de En. de 2023

Comentada:

el 24 de En. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by