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

9 views (last 30 days)
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

Walter Roberson
Walter Roberson on 10 Jun 2019
odeFunction()
Or
syms theta(t) omega
dtheta = diff(theta,t);
y = sin(theta);
yPrime = subs(diff(y,t), dtheta, omega);

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!