How to calculate derivatives in matlab: 1. Open the matlab software; 2. Enter the command "sysm x" to define a symbolic variable, and enter the command "f1=atan(x)" to define a function; 3. Enter " Use the "df1=diff(f1,x)" command to find the derivative; 4. Enter the "subplot" command to output.
The operating environment of this tutorial: windows7 system, matlab R2012b, Dell G3 computer.
How to find the derivative in matlab?
The operation method is as follows:
1. Open the matlab software;
2. Enter the command clear;clc; to clear the job Space;
3. Enter the command sysm x to define a symbolic variable, as shown in the figure;
4. Enter the instruction f1=atan(x) to define a function;
5. Enter the instruction df1=diff(f1,x) to solve the symbolic solution of the derivative function;
6. Enter the following command to view the derivation results, as shown in the figure;
subplot(1,2,1);ezplot(f1),grid on;subplot(1,2,2);ezplot(df1),grid on;
7. View the derivation results as follows.
The above is the detailed content of How to find the derivative in matlab. For more information, please follow other related articles on the PHP Chinese website!