MATLAB: Calculating derivative of a function derivative function a=62; b=95; y = @(x) (3*x.^2.*sin(a*x))./(x.^2+b); dy = diff(y) I don't know exactly how i need to calculate the derivative correctly. Best Answer syms xa=62;b=95;y = (3*x.^2.*sin(a*x))./(x.^2+b);dy = diff(y) Related SolutionsMATLAB: Second Derivative using diff I wouldn’t use diff to calculate numerical derivatives. It has its uses, but I always use the gradient function for derivative calculations, since gradient produces a result the same size as its argument. MATLAB: How to find total derivative Hey Kanav,Check out "diff" in the Symbolic Math Toolbox. One thing to note is that for the form you want, you need to explicitly define y as a function of x.syms x y(x)diff(cos(x) - sin(y)*x,x)returns- sin(y(x)) - sin(x) - x*cos(y(x))*diff(y(x), x)-Adam Related QuestionCalculating mixed partial derivatives of a function A(x,y)Differentiated system of equations with input at one of the variables
Best Answer