Application of Differential Function in MATLAB
Application of Differential Function in MATLAB
Methodology: In this report, 2 commands and some functions will be used to make
derivatives with the help of MATLAB. The commands are ‘syms and diff’. Some functions and
derivatives are shown below :
1. syms x
Y=sin(x);
F=diff(Y)
2. syms x y
Z=3*sin(x)-12*cos(y);
F1=diff(Z,x)
F2=diff(Z,y)
3. syms x y z
A=sin(x)+cos(y)+exp(z);
F3=diff(A)
4. syms x
B=(sec(x)*exp(-1.5*x))/(tan(x)*exp(x)-x^3);
F4=diff(B)
5. syms x
x=1:15;
C= (cos(x).*exp(-1.5*x) + log(x)./(3*x.^2.*cos(x) - sin(x).*exp(x)*0));
plot(x,C)
Result:
Discussion: For differentiation, we can differentiation an array of data using
gradient, which uses a finite difference formula to calculate derivatives of
functional expressions, we must use MATLAB.