MATLAB: Derivative of a function of two variables

derivationsymbolic toolbox

Hello,
How can I get such a derivative in Matlab-Symbolic Toolbox ?
Differentiation according to two variables q1 and q2.
y=L1*cos(q1)+L2*cos(q2)
y´=-L1*sin(q1)-L2*cos(q2)
There is only this alternative?
z´=diff(y,q1)+diff(y,q2)
Thank you very much

Best Answer

To get a numerical difference (symmetric difference), you calculate (f(x+dx)-f(x-dx))/(2*dx)
or "gradient", "polyder" (calculates the derivative of a polynomial) functions. Also a function "derivest" could also give numerical differentiation.