function - Matlab second order derivative - Stack Overflow
stackoverflow.com › questions › 15158378Mar 01, 2013 · Matlab second order derivative. Bookmark this question. Show activity on this post. I have followed the tutorial on http://www.mit.edu/people/abbe/matlab/ode.html and prepared a function as follows: function dxy = diffxy (xy) % %split xy into variables in our equations % x = xy (1); xdot = xy (2); y = xy (3); % % define the derivatives of these variables from equations % xdot = xdot; ydot = 3*x + 2*y + 5; xdoubledot = 3 - ydot + 2*xdot; % %return the derivatives in dxy in the right order ...
Differentiation - MATLAB & Simulink
www.mathworks.com › help › symbolicTo determine the default variable that MATLAB differentiates with respect to, use symvar: symvar (f, 1) ans = t. Calculate the second derivative of f with respect to t: diff (f, t, 2) This command returns. ans = -s^2*sin (s*t) Note that diff (f, 2) returns the same answer because t is the default variable.