How take derivative d/dt(sinx), but have result be cosx * d/dt(x) ?

3 vues (au cours des 30 derniers jours)
Justin Burzachiello
Justin Burzachiello le 25 Juin 2021
Hello. I'd like to take a derivative of a function, sin(x). I have defined xDot as a symbol (the temporal derivative of x).
However, when I take d/dt (sinx) through
diff(sin(x), t, 1)
, I get 0. I want to have the returned expression be cos(x)*d/dt(x). How can I do this?

Réponse acceptée

Steven Lord
Steven Lord le 25 Juin 2021
Tell MATLAB x is a function of t.
syms t x(t)
d = diff(sin(x), t)
d(t) = 

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by