MATLAB: Diff of order n around a point x0 diff()MATLAB Hello, I would like to calculate the derivative of order n of function f with respect to x aaround a point x0. diff(f,x,x0,n) but doesn't work Any help!! Thank you in advance. Adam Best Answer Do you have the Symbolic Toolbox and an expression for your function?syms tx = cos(2*t);y = diff(x,2)subs(y,0) %evaluate the 2nd derivative at t=0 Related SolutionsMATLAB: “Substitution function” by symbolic math toolbox doc subs %? MATLAB: How to calculate derivative of a string eq='x^2+x';f = sym(str2func(['@(x)',eq]));g = diff(f) Related QuestionFsolve with multidimensional array and x0Fminsearch – find best x0About gradient and diffHow choose MultiStart x0Expression of the equations in the Symbolic Math Toolbox.
Best Answer