MATLAB 求导diff
2016-06-07 11:18
344 查看
diff
Differentiate symbolic expression_r_r
求符号表达式的微分
Syntax
diff(expr)
diff(expr, v)
diff(expr, sym(‘v’))
diff(expr, n)
diff(expr, v, n)
diff(expr, n, v)
Description
diff(expr) differentiates a symbolic expression_r_r expr with respect to its free variable as determined by symvar.
diff(expr, v) and diff(expr, sym(‘v’)) differentiate expr with respect to v.
diff(expr, n) differentiates expr n times. n is a positive integer.
diff(expr, v, n) and diff(expr, n, v) differentiate expr with respect to v n times.
diff(expr) 求一个符号表达式expr相对于由symvar确定的自由变量的微分。
Examples
Differentiate the following single-variable expression_r_r one time:
The result is
ans = 2*x*cos(x^2)
Differentiate the following single-variable expression_r_r six times:
The result is
ans = 720
Differentiate the following expression_r_r with respect to t:
The result is
ans = 2*t*x*cos(t^2*x)
综合应用
给定函数f(x)=cosx/(x3+7x+2)的一阶导数,并将每个点上的值与原函数的值通过matlab函数绘制出来.
subs用法见http://blog.sina.com.cn/s/blog_4b94ff130100gdk9.html
一阶导数
绘制原函数以及求导后函数曲线
Differentiate symbolic expression_r_r
求符号表达式的微分
Syntax
diff(expr)
diff(expr, v)
diff(expr, sym(‘v’))
diff(expr, n)
diff(expr, v, n)
diff(expr, n, v)
Description
diff(expr) differentiates a symbolic expression_r_r expr with respect to its free variable as determined by symvar.
diff(expr, v) and diff(expr, sym(‘v’)) differentiate expr with respect to v.
diff(expr, n) differentiates expr n times. n is a positive integer.
diff(expr, v, n) and diff(expr, n, v) differentiate expr with respect to v n times.
diff(expr) 求一个符号表达式expr相对于由symvar确定的自由变量的微分。
Examples
Differentiate the following single-variable expression_r_r one time:
syms x; diff(sin(x^2))
The result is
ans = 2*x*cos(x^2)
Differentiate the following single-variable expression_r_r six times:
syms t; diff(t^6,6)
The result is
ans = 720
Differentiate the following expression_r_r with respect to t:
syms x t; diff(sin(x*t^2), t)
The result is
ans = 2*t*x*cos(t^2*x)
综合应用
给定函数f(x)=cosx/(x3+7x+2)的一阶导数,并将每个点上的值与原函数的值通过matlab函数绘制出来.
subs用法见http://blog.sina.com.cn/s/blog_4b94ff130100gdk9.html
一阶导数
syms x; f=cos(x)/(x^3+7*x+2); f1d=diff(f,x) pretty(f1d)
绘制原函数以及求导后函数曲线
x1=0:0.001:5; y=subs(f,x,x1); y1d=subs(f1d,x,x1); plot(x1,y,x1,y1d,':')
相关文章推荐
- MatlabR2014a 安装破解详细图文教程(附下载链接(内附CVX工具箱))
- matlab实现CP分解 代码
- solve mass matrix in matlab
- MATLAB中为控件(uicontrol)绑定Callback函数(回调函数)
- matlab基础
- 深度学习FPGA实现基础知识9(Deep Learning(深度学习)Matlab工具箱下载、安装、测试)
- 深度学习FPGA实现基础知识8(Deep Learning(深度学习)Matlab实现--简单清晰的实验)
- 深度学习FPGA实现基础知识7(深度学习Matlab工具箱代码详解)
- size函数
- MATLAB之fprintf函数的具体使用方法
- MATLAB之fopen函数
- 快速傅里叶介绍-matlab
- MATLAB之kaiserord函数
- matlab--“下标索引必须为正整数类型或逻辑类型”
- matlab读取/播放视频的函数以及写入/合成视频函数
- windows下python调用matlab
- caffe的Matlab接口问题之路径问题
- Matlab中cell与其它类型之间的转换
- 基于PCA的人脸识别_Matlab实现(个人研读之后的一些总结)
- matlab下libjpeg工具箱(jpegtbx1.4)的安装与配置,包括IJG库的编译配置(综合整理网上资料)