In Symbolic Math, how do you output a partial derivative as a variable?

Hello
How can I do this?
y = sin(theta)
yPrime = diff(y,t)
The output I need is omega*cos(theta)
Matlab outputs the partial derivative of theta with respect to t. How can I replace the partial derivate for a variable?
Thank you!

 Accepted Answer

odeFunction()
Or
syms theta(t) omega
dtheta = diff(theta,t);
y = sin(theta);
yPrime = subs(diff(y,t), dtheta, omega);

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!