SlideShare a Scribd company logo
1 of 1
第二章        用 MATLAB 求导
  当求导的函数比较复杂,或者是求高阶导数时,计算量是很大的。此时可以
用 MATLAB 的 diff 命令来求导数。
  例 2.5.1 求 y = x 的导数。
                           sin x


      解 syms x ↙
                diff(x^sin(x)) ↙
               ans=
         x^sin(x)*(cos(x)*log(x)+sin(x)/x)
可以用 pretty 命令来整理一下显示结果,使之更符合一般的书写格式
     pretty(ans) ↙
                                     sin x
       x sin x [cos( x) log( x) +          ]
                                       x
 例 2.5.2 求 y = e 的高阶导数。
                        ax


 解 syms a x ↙
   diff(exp(a*x),x,3) ↙
          ans=
                   a^3*exp(a*x)
         diff(exp(a*x),x,30) ↙
  ans=
                   a^30*exp(a*x)
即 y ′′′ = a e , y = a e 。
              3 ax   (30)        30 ax


                                             x = 1+ t2
                                                                dy
   例 2.5.3 函数 y 由参数方程                                      ,确定,求 。
                                              y = arctan t
                                                                dx
   解   syms t        ↙
        x=sqrt(1+t ∧ 2);     ↙
        y=atan(t)       ↙
  pretty(diffy)/deff(x)) ↙
         1
   (1 + t 2 )1/ 2 t
   dy             1
即得 =
   dx t 1 + t 2

More Related Content

What's hot

Operations on Continuous Time Signals
Operations on Continuous Time SignalsOperations on Continuous Time Signals
Operations on Continuous Time SignalsAl-Amin Islam
 
Note on fourier transform of unit step function
Note on fourier transform of unit step functionNote on fourier transform of unit step function
Note on fourier transform of unit step functionAnand Krishnamoorthy
 
Chapter5 - The Discrete-Time Fourier Transform
Chapter5 - The Discrete-Time Fourier TransformChapter5 - The Discrete-Time Fourier Transform
Chapter5 - The Discrete-Time Fourier TransformAttaporn Ninsuwan
 
Getting started with High-Definition Render Pipeline for games- Unite Copenha...
Getting started with High-Definition Render Pipeline for games- Unite Copenha...Getting started with High-Definition Render Pipeline for games- Unite Copenha...
Getting started with High-Definition Render Pipeline for games- Unite Copenha...Unity Technologies
 
Dsp U Lec05 The Z Transform
Dsp U   Lec05 The Z TransformDsp U   Lec05 The Z Transform
Dsp U Lec05 The Z Transformtaha25
 
Matlab Graphics Tutorial
Matlab Graphics TutorialMatlab Graphics Tutorial
Matlab Graphics TutorialCheng-An Yang
 
First order non-linear partial differential equation & its applications
First order non-linear partial differential equation & its applicationsFirst order non-linear partial differential equation & its applications
First order non-linear partial differential equation & its applicationsJayanshu Gundaniya
 
All Differentiation
All  DifferentiationAll  Differentiation
All Differentiationmrmcdowall
 
AD-IP-JESD204 JESD204B Interface Framework
AD-IP-JESD204 JESD204B Interface FrameworkAD-IP-JESD204 JESD204B Interface Framework
AD-IP-JESD204 JESD204B Interface FrameworkAnalog Devices, Inc.
 
I fase control ii ecuaciones en diferencias (3)
I fase control ii ecuaciones en diferencias (3)I fase control ii ecuaciones en diferencias (3)
I fase control ii ecuaciones en diferencias (3)ricardozegarra7
 
Ordinary differential equation
Ordinary differential equationOrdinary differential equation
Ordinary differential equationJUGAL BORAH
 

What's hot (15)

inverse z transform
inverse z transforminverse z transform
inverse z transform
 
Operations on Continuous Time Signals
Operations on Continuous Time SignalsOperations on Continuous Time Signals
Operations on Continuous Time Signals
 
Note on fourier transform of unit step function
Note on fourier transform of unit step functionNote on fourier transform of unit step function
Note on fourier transform of unit step function
 
Chapter5 - The Discrete-Time Fourier Transform
Chapter5 - The Discrete-Time Fourier TransformChapter5 - The Discrete-Time Fourier Transform
Chapter5 - The Discrete-Time Fourier Transform
 
Getting started with High-Definition Render Pipeline for games- Unite Copenha...
Getting started with High-Definition Render Pipeline for games- Unite Copenha...Getting started with High-Definition Render Pipeline for games- Unite Copenha...
Getting started with High-Definition Render Pipeline for games- Unite Copenha...
 
Dsp U Lec05 The Z Transform
Dsp U   Lec05 The Z TransformDsp U   Lec05 The Z Transform
Dsp U Lec05 The Z Transform
 
z transforms
z transformsz transforms
z transforms
 
Matlab Graphics Tutorial
Matlab Graphics TutorialMatlab Graphics Tutorial
Matlab Graphics Tutorial
 
First order non-linear partial differential equation & its applications
First order non-linear partial differential equation & its applicationsFirst order non-linear partial differential equation & its applications
First order non-linear partial differential equation & its applications
 
All Differentiation
All  DifferentiationAll  Differentiation
All Differentiation
 
Pseudo Random Code
Pseudo Random CodePseudo Random Code
Pseudo Random Code
 
AD-IP-JESD204 JESD204B Interface Framework
AD-IP-JESD204 JESD204B Interface FrameworkAD-IP-JESD204 JESD204B Interface Framework
AD-IP-JESD204 JESD204B Interface Framework
 
I fase control ii ecuaciones en diferencias (3)
I fase control ii ecuaciones en diferencias (3)I fase control ii ecuaciones en diferencias (3)
I fase control ii ecuaciones en diferencias (3)
 
Fourier transform
Fourier transformFourier transform
Fourier transform
 
Ordinary differential equation
Ordinary differential equationOrdinary differential equation
Ordinary differential equation
 

Similar to 02.第二章用Matlab求导

07.第七章用Matlab解常微分方程
07.第七章用Matlab解常微分方程07.第七章用Matlab解常微分方程
07.第七章用Matlab解常微分方程Xin Zheng
 
实验五 用Mathematica软件计算一元函数的积分
实验五  用Mathematica软件计算一元函数的积分实验五  用Mathematica软件计算一元函数的积分
实验五 用Mathematica软件计算一元函数的积分Xin Zheng
 
实验五 用Mathematica软件计算一元函数的积分
实验五  用Mathematica软件计算一元函数的积分实验五  用Mathematica软件计算一元函数的积分
实验五 用Mathematica软件计算一元函数的积分guestfe33f0e
 
241525第三章初等代数运算命令与例题
241525第三章初等代数运算命令与例题241525第三章初等代数运算命令与例题
241525第三章初等代数运算命令与例题gwadhysys
 
指考乙公式
指考乙公式指考乙公式
指考乙公式zoayzoay
 
中山女高99下高3第1次段考數學科 自然組
中山女高99下高3第1次段考數學科 自然組 中山女高99下高3第1次段考數學科 自然組
中山女高99下高3第1次段考數學科 自然組 lyt199529
 
通信网第二三章习题答案
通信网第二三章习题答案通信网第二三章习题答案
通信网第二三章习题答案bupt
 
指考甲公式
指考甲公式指考甲公式
指考甲公式zoayzoay
 
【逆轉勝】數學學測總複習講義
【逆轉勝】數學學測總複習講義【逆轉勝】數學學測總複習講義
【逆轉勝】數學學測總複習講義lungtengtech
 
09.第九章用Matlab求二元泰勒展开式
09.第九章用Matlab求二元泰勒展开式09.第九章用Matlab求二元泰勒展开式
09.第九章用Matlab求二元泰勒展开式Xin Zheng
 
实验九 用Mathematica软件求函数偏导数与多元函数的极值
实验九  用Mathematica软件求函数偏导数与多元函数的极值实验九  用Mathematica软件求函数偏导数与多元函数的极值
实验九 用Mathematica软件求函数偏导数与多元函数的极值guestfe33f0e
 
实验九 用Mathematica软件求函数偏导数与多元函数的极值
实验九  用Mathematica软件求函数偏导数与多元函数的极值实验九  用Mathematica软件求函数偏导数与多元函数的极值
实验九 用Mathematica软件求函数偏导数与多元函数的极值Xin Zheng
 
第2章符 号 运 算
第2章符 号 运 算第2章符 号 运 算
第2章符 号 运 算eterou
 
Algorithms.exercises.solution
Algorithms.exercises.solutionAlgorithms.exercises.solution
Algorithms.exercises.solutionRegina Long
 
福建省福州大学2019年暑假物理竞赛夏令营-物理奥赛进阶之路:0-1+微积分初步+40张ppt.pptx
福建省福州大学2019年暑假物理竞赛夏令营-物理奥赛进阶之路:0-1+微积分初步+40张ppt.pptx福建省福州大学2019年暑假物理竞赛夏令营-物理奥赛进阶之路:0-1+微积分初步+40张ppt.pptx
福建省福州大学2019年暑假物理竞赛夏令营-物理奥赛进阶之路:0-1+微积分初步+40张ppt.pptxyantingguo2008
 
实验一 Mathematica软件简介
实验一   Mathematica软件简介实验一   Mathematica软件简介
实验一 Mathematica软件简介guestfe33f0e
 

Similar to 02.第二章用Matlab求导 (20)

07.第七章用Matlab解常微分方程
07.第七章用Matlab解常微分方程07.第七章用Matlab解常微分方程
07.第七章用Matlab解常微分方程
 
曲線弧長
曲線弧長曲線弧長
曲線弧長
 
实验五 用Mathematica软件计算一元函数的积分
实验五  用Mathematica软件计算一元函数的积分实验五  用Mathematica软件计算一元函数的积分
实验五 用Mathematica软件计算一元函数的积分
 
实验五 用Mathematica软件计算一元函数的积分
实验五  用Mathematica软件计算一元函数的积分实验五  用Mathematica软件计算一元函数的积分
实验五 用Mathematica软件计算一元函数的积分
 
3 1矩陣列運算
3 1矩陣列運算3 1矩陣列運算
3 1矩陣列運算
 
1 2指數函數
1 2指數函數1 2指數函數
1 2指數函數
 
241525第三章初等代数运算命令与例题
241525第三章初等代数运算命令与例题241525第三章初等代数运算命令与例题
241525第三章初等代数运算命令与例题
 
指考乙公式
指考乙公式指考乙公式
指考乙公式
 
中山女高99下高3第1次段考數學科 自然組
中山女高99下高3第1次段考數學科 自然組 中山女高99下高3第1次段考數學科 自然組
中山女高99下高3第1次段考數學科 自然組
 
通信网第二三章习题答案
通信网第二三章习题答案通信网第二三章习题答案
通信网第二三章习题答案
 
指考甲公式
指考甲公式指考甲公式
指考甲公式
 
【逆轉勝】數學學測總複習講義
【逆轉勝】數學學測總複習講義【逆轉勝】數學學測總複習講義
【逆轉勝】數學學測總複習講義
 
09.第九章用Matlab求二元泰勒展开式
09.第九章用Matlab求二元泰勒展开式09.第九章用Matlab求二元泰勒展开式
09.第九章用Matlab求二元泰勒展开式
 
实验九 用Mathematica软件求函数偏导数与多元函数的极值
实验九  用Mathematica软件求函数偏导数与多元函数的极值实验九  用Mathematica软件求函数偏导数与多元函数的极值
实验九 用Mathematica软件求函数偏导数与多元函数的极值
 
实验九 用Mathematica软件求函数偏导数与多元函数的极值
实验九  用Mathematica软件求函数偏导数与多元函数的极值实验九  用Mathematica软件求函数偏导数与多元函数的极值
实验九 用Mathematica软件求函数偏导数与多元函数的极值
 
Hermite.pdf
Hermite.pdfHermite.pdf
Hermite.pdf
 
第2章符 号 运 算
第2章符 号 运 算第2章符 号 运 算
第2章符 号 运 算
 
Algorithms.exercises.solution
Algorithms.exercises.solutionAlgorithms.exercises.solution
Algorithms.exercises.solution
 
福建省福州大学2019年暑假物理竞赛夏令营-物理奥赛进阶之路:0-1+微积分初步+40张ppt.pptx
福建省福州大学2019年暑假物理竞赛夏令营-物理奥赛进阶之路:0-1+微积分初步+40张ppt.pptx福建省福州大学2019年暑假物理竞赛夏令营-物理奥赛进阶之路:0-1+微积分初步+40张ppt.pptx
福建省福州大学2019年暑假物理竞赛夏令营-物理奥赛进阶之路:0-1+微积分初步+40张ppt.pptx
 
实验一 Mathematica软件简介
实验一   Mathematica软件简介实验一   Mathematica软件简介
实验一 Mathematica软件简介
 

More from Xin Zheng

Humidity and temperature
Humidity and temperatureHumidity and temperature
Humidity and temperatureXin Zheng
 
Humidity and temperature
Humidity and temperatureHumidity and temperature
Humidity and temperatureXin Zheng
 
Release coats presentation-pstc
Release coats presentation-pstcRelease coats presentation-pstc
Release coats presentation-pstcXin Zheng
 
Release coating special additive product selection guide
Release coating special additive product selection guideRelease coating special additive product selection guide
Release coating special additive product selection guideXin Zheng
 
12.第十二章用Matlab计算第二类积分
12.第十二章用Matlab计算第二类积分12.第十二章用Matlab计算第二类积分
12.第十二章用Matlab计算第二类积分Xin Zheng
 
10.第十章用Matlab画空间曲线
10.第十章用Matlab画空间曲线10.第十章用Matlab画空间曲线
10.第十章用Matlab画空间曲线Xin Zheng
 
08.第八章用Matlab求二元泰勒展开式
08.第八章用Matlab求二元泰勒展开式08.第八章用Matlab求二元泰勒展开式
08.第八章用Matlab求二元泰勒展开式Xin Zheng
 
03.第三章用Matlab求极值
03.第三章用Matlab求极值03.第三章用Matlab求极值
03.第三章用Matlab求极值Xin Zheng
 
06.第六章用Matlab计算二重积分
06.第六章用Matlab计算二重积分06.第六章用Matlab计算二重积分
06.第六章用Matlab计算二重积分Xin Zheng
 
04.第四章用Matlab求偏导数
04.第四章用Matlab求偏导数04.第四章用Matlab求偏导数
04.第四章用Matlab求偏导数Xin Zheng
 
01.第一章用Matlab求极限
01.第一章用Matlab求极限01.第一章用Matlab求极限
01.第一章用Matlab求极限Xin Zheng
 
实验十 用Mathematica计算重积分
实验十  用Mathematica计算重积分实验十  用Mathematica计算重积分
实验十 用Mathematica计算重积分Xin Zheng
 
实验一 Mathematica软件简介
实验一   Mathematica软件简介实验一   Mathematica软件简介
实验一 Mathematica软件简介Xin Zheng
 
实验四 用Mathematica软件作导数应用
实验四  用Mathematica软件作导数应用实验四  用Mathematica软件作导数应用
实验四 用Mathematica软件作导数应用Xin Zheng
 
实验六 用Mathematica软件进行 级数运算
实验六  用Mathematica软件进行 级数运算实验六  用Mathematica软件进行 级数运算
实验六 用Mathematica软件进行 级数运算Xin Zheng
 
实验三 用Mathematica软件计算导数与微分
实验三  用Mathematica软件计算导数与微分实验三  用Mathematica软件计算导数与微分
实验三 用Mathematica软件计算导数与微分Xin Zheng
 
实验七 用Mathematica解常微分方程
实验七  用Mathematica解常微分方程实验七  用Mathematica解常微分方程
实验七 用Mathematica解常微分方程Xin Zheng
 
实验二 用Mathmatica软件求极限
实验二  用Mathmatica软件求极限实验二  用Mathmatica软件求极限
实验二 用Mathmatica软件求极限Xin Zheng
 
实验八 用Mathematica进行向量运算及曲面绘制
实验八  用Mathematica进行向量运算及曲面绘制实验八  用Mathematica进行向量运算及曲面绘制
实验八 用Mathematica进行向量运算及曲面绘制Xin Zheng
 
高分子化学 - 第六章 配位聚合(Coordination Polymerization)
高分子化学 - 第六章 配位聚合(Coordination Polymerization)高分子化学 - 第六章 配位聚合(Coordination Polymerization)
高分子化学 - 第六章 配位聚合(Coordination Polymerization)Xin Zheng
 

More from Xin Zheng (20)

Humidity and temperature
Humidity and temperatureHumidity and temperature
Humidity and temperature
 
Humidity and temperature
Humidity and temperatureHumidity and temperature
Humidity and temperature
 
Release coats presentation-pstc
Release coats presentation-pstcRelease coats presentation-pstc
Release coats presentation-pstc
 
Release coating special additive product selection guide
Release coating special additive product selection guideRelease coating special additive product selection guide
Release coating special additive product selection guide
 
12.第十二章用Matlab计算第二类积分
12.第十二章用Matlab计算第二类积分12.第十二章用Matlab计算第二类积分
12.第十二章用Matlab计算第二类积分
 
10.第十章用Matlab画空间曲线
10.第十章用Matlab画空间曲线10.第十章用Matlab画空间曲线
10.第十章用Matlab画空间曲线
 
08.第八章用Matlab求二元泰勒展开式
08.第八章用Matlab求二元泰勒展开式08.第八章用Matlab求二元泰勒展开式
08.第八章用Matlab求二元泰勒展开式
 
03.第三章用Matlab求极值
03.第三章用Matlab求极值03.第三章用Matlab求极值
03.第三章用Matlab求极值
 
06.第六章用Matlab计算二重积分
06.第六章用Matlab计算二重积分06.第六章用Matlab计算二重积分
06.第六章用Matlab计算二重积分
 
04.第四章用Matlab求偏导数
04.第四章用Matlab求偏导数04.第四章用Matlab求偏导数
04.第四章用Matlab求偏导数
 
01.第一章用Matlab求极限
01.第一章用Matlab求极限01.第一章用Matlab求极限
01.第一章用Matlab求极限
 
实验十 用Mathematica计算重积分
实验十  用Mathematica计算重积分实验十  用Mathematica计算重积分
实验十 用Mathematica计算重积分
 
实验一 Mathematica软件简介
实验一   Mathematica软件简介实验一   Mathematica软件简介
实验一 Mathematica软件简介
 
实验四 用Mathematica软件作导数应用
实验四  用Mathematica软件作导数应用实验四  用Mathematica软件作导数应用
实验四 用Mathematica软件作导数应用
 
实验六 用Mathematica软件进行 级数运算
实验六  用Mathematica软件进行 级数运算实验六  用Mathematica软件进行 级数运算
实验六 用Mathematica软件进行 级数运算
 
实验三 用Mathematica软件计算导数与微分
实验三  用Mathematica软件计算导数与微分实验三  用Mathematica软件计算导数与微分
实验三 用Mathematica软件计算导数与微分
 
实验七 用Mathematica解常微分方程
实验七  用Mathematica解常微分方程实验七  用Mathematica解常微分方程
实验七 用Mathematica解常微分方程
 
实验二 用Mathmatica软件求极限
实验二  用Mathmatica软件求极限实验二  用Mathmatica软件求极限
实验二 用Mathmatica软件求极限
 
实验八 用Mathematica进行向量运算及曲面绘制
实验八  用Mathematica进行向量运算及曲面绘制实验八  用Mathematica进行向量运算及曲面绘制
实验八 用Mathematica进行向量运算及曲面绘制
 
高分子化学 - 第六章 配位聚合(Coordination Polymerization)
高分子化学 - 第六章 配位聚合(Coordination Polymerization)高分子化学 - 第六章 配位聚合(Coordination Polymerization)
高分子化学 - 第六章 配位聚合(Coordination Polymerization)
 

02.第二章用Matlab求导

  • 1. 第二章 用 MATLAB 求导 当求导的函数比较复杂,或者是求高阶导数时,计算量是很大的。此时可以 用 MATLAB 的 diff 命令来求导数。 例 2.5.1 求 y = x 的导数。 sin x 解 syms x ↙ diff(x^sin(x)) ↙ ans= x^sin(x)*(cos(x)*log(x)+sin(x)/x) 可以用 pretty 命令来整理一下显示结果,使之更符合一般的书写格式 pretty(ans) ↙ sin x x sin x [cos( x) log( x) + ] x 例 2.5.2 求 y = e 的高阶导数。 ax 解 syms a x ↙ diff(exp(a*x),x,3) ↙ ans= a^3*exp(a*x) diff(exp(a*x),x,30) ↙ ans= a^30*exp(a*x) 即 y ′′′ = a e , y = a e 。 3 ax (30) 30 ax x = 1+ t2  dy 例 2.5.3 函数 y 由参数方程  ,确定,求 。  y = arctan t  dx 解 syms t ↙ x=sqrt(1+t ∧ 2); ↙ y=atan(t) ↙ pretty(diffy)/deff(x)) ↙ 1 (1 + t 2 )1/ 2 t dy 1 即得 = dx t 1 + t 2