![]() |
VOOZH | about |
Differentiation of a function y = f(x) tells us how the value of y changes with respect to change in x. It can also be termed as the slope of a function.
Derivative of a function f(x) wrt to x is represented as
MATLAB allows users to calculate the derivative of a function using diff() method. Different syntax of diff() method are:
It returns the derivative of function f(x) wrt variable x.
Example 1:
Output :
👁 ImageExample 2: Evaluating the derivative of a function at a specified value using subs(y,x,k).
Output :
👁 ImageOutput :
👁 ImageIt returns the double derivative of function f with respect to variable b.
Example 1:
Output :
👁 ImageIn the same way, you can also calculate the k-order derivative of function f using diff(f,x,k).
Example 2:
Calculating the partial derivative } using Jacobian matrix and determinant.
Output :