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

MATLABpartial derivativesymbolic mathSymbolic Math Toolbox

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!

Best Answer

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