Simlify a function in matlab
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Walter Roberson
le 23 Jan 2023
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))
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Numbers and Precision dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!