




已阅读5页,还剩167页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
2014 5 5 Matlab 程序设计 课程实验 张羽飞 伍慧婷 物理院电信 1201 班 页 1 目录 MatlabMatlab 操作实验 第操作实验 第 1 1 章 章 实验指导 思考练习 矩阵运算实验 第矩阵运算实验 第 2 2 章 章 实验指导 思考练习 程序设计实验 第程序设计实验 第 3 3 章 章 实验指导 思考练习 高级绘图实验 第高级绘图实验 第 4 4 章 章 实验指导 思考练习 数据分析与多项式计算实验 第数据分析与多项式计算实验 第 5 5 章 章 实验指导 思考练习 解方程与最优化问题求解实验 第解方程与最优化问题求解实验 第 6 6 章 章 实验指导 思考练习 数值运算实验 第数值运算实验 第 7 7 章 章 实验指导 思考练习 符号实验 第符号实验 第 8 8 章 章 实验指导 页 2 思考练习 图形句柄实验 第图形句柄实验 第 9 9 章 章 实验指导 思考练习 图形用户界面设计实验 第图形用户界面设计实验 第 1010 章 章 实验指导 思考练习 Simulink 动态仿真实验 第动态仿真实验 第 11 章 章 实验指导 思考练习 外部接口技术实验 第外部接口技术实验 第 12 章 章 实验指导 思考练习 页 3 1 Matlab 操作实验 一 实验内容 1 第一章 实验内容 1 path path 系统盘名 matlab 文件名 要添加的文件名 如 path path c matlab701 my work 实验内容 2 例 1 1 x 0 0 5 360 pi 180 plot x sin x x cos x 例 1 2 p 3 7 9 0 23 x roots p 页 4 例 1 3 quad x log 1 x 0 1 例 1 4 实验内容 3 Help 函数名 如 help inv help plot 等 页 5 实验内容 4 1 x 0 pi 10 2 pi y sin x 页 6 二 思考练习 思考题 1 启动 有三种常见方法 1 在 Windows 桌面 单机任务栏上的 开始 按钮 选择 所有 程序 菜单项 然后选择 MATLAB 程序组中的 MATLAB 版本号 程序选 项 即可启动 2 在 MATLAB 的安装路径中找到 MATLAB 系统启动程序 matlab exe 然后运行它 页 7 3 利用建立快捷方式功能 将 MATLAB 系统启动程序以快捷方 式的形式放在 Windows 桌面上 以后只要在桌面上双击该图标即可启动 MATLAB 关闭 常见的也有 3 种方法 1 在 MATLAB 主窗口 file 菜单中选择 exit MATLAB 命令 2 在 MATLAB 命令窗口中输入 exit 或 quit 命令 3 单击 MATLAB 主窗口的 关闭 按钮 思考题 2 1 数值计算和符号计算功能 2 绘图功能 3 编程语言功能 4 扩展功能 思考题 3 在未完的物理行末以续行符 结束 则可以在下一行继续输入命令的 其他部分 思考题 4 Help 命令至搜索出那些与关键字完全匹配的结果 lookfor 命令则对 搜索范围内的 M 文件进行关键字搜索 条件比较宽松 如 因为不存在 inverse 函数 输入命令 help inverse 搜索结果为 inverse not found 而输 入 lookfor inverse 将得到 M 文件中包含 inverse 的全部函数 另 lookfor 命令支队 M 文件的第一行关键字搜索 若在 lookfor 命令后加上 all 选项 则可对 M 文件进行全文搜索 思考题 5 可以采用避开当前工作空间电脑函数调用方式 页 8 2 矩阵运算实验 一 实验内容 实验内容 1 1 format long w sqrt 2 1 0 34245e 6 2 a 3 5 b 5 c 9 8 e 2 718 x 2 pi a b c pi a b c e 2 tan b c a 3 a 3 32 b 7 9 y 2 pi 2 a 1 pi 4 b 0 8333 pi 4 a 页 9 4 t 2 1 3i 5 0 65 e 2 718 z 1 2 e 2 t log t sqrt 1 e 2 2 A 1 5 4 0 7 8 3 61 7 B 8 3 1 2 5 3 3 2 0 I 1 0 0 0 1 0 0 0 1 1 A 6 B A 2 B I 2 A B A B B A 页 10 3 A B B A 4 A B A 1 3 B 2 页 11 页 12 3 A 23 10 0 778 0 41 45 65 5 32 5 0 32 6 9 45 54 3 14 1 A A 10C A 1 2 D A 2 4 3 4 E B C 3 E 90 end if an a 3 0 1 3 b exp 0 3 a exp 0 3 a 2 c sin a 0 3 y b c log 0 3 a 2 页 25 页 26 循环结构 for i 1 61 a i 3 0 1 i 1 y i exp 0 3 a i exp 0 3 a i 2 sin a i 0 3 log 0 3 a i 2 y i End 页 27 页 28 5 循环结构 1 n 100 A 0 页 29 for i 1 n A 1 i i A end A n 1000时 n 10000时 2 n 100 A 1 for i 1 n A 2 n n 2 2 n 1 2 n 1 end A 页 30 N 1000时 N 10000时 向量运算 1 sum 0 n input input a number for i 1 n sum sum 1 i 2 end Sum 页 31 2 sum 1 n input input a number for i 1 n sum sum 2 i i 2 2 i 1 2 i 1 end sum 页 32 6 A rand 5 6 A n input please input a number if n 5 n 0 B A 5 disp 输入错误 程序自动输出最后一行元素 num2str B else C A n disp 输出结果是 num2str C End 页 33 7 y1 f1 40 f1 30 f2 20 y2 f2 40 f2 30 f2 20 y1 y2 函数定义 f1 m function m f1 n m n 10 log n n 5 f2 m function m f2 n m 0 for i 1 n m m i i 1 End 页 34 8 s factor1 100 factor2 50 factor3 10 函数定义 1 的定义 100 1i k function f factor1 n if n 1 f 1 else f factor1 n 1 n End 2 的定义 50 1 2 i k function f factor2 n if n 1 f 1 else f factor2 n 1 n 2 end 3 的定义 10 1 1 i k function f factor3 n 页 35 if n 1 f 1 else f factor3 n 1 1 n end 2 思考练习 1 用 MATLAB 语言编写的程序 成为 M 文件 M 文件的建立 M 文件是一个文本文件 他可以用任何编辑程序来建 立和编辑 而一般最为常用且方便的是使用 MATLAB 提供的文本编辑器 而 启动 MATLAB 文本编辑器的方法有 3 种 1 菜单操作 从 MATLAB 主窗口的 File 菜单中选择 New 菜单项 再 选择 M file 命令 2 命令操作 在 MATLAB 命令窗口输入命令 edit 启动 MATLAB 文本 编辑器后 输入 M 文件的内容并存盘 3 命令按钮操作 单击 MATLAB 主窗口工具栏上的 New M File 命令 按钮 启动 MATLAB 文本编辑器后 输入 M 文件的内容并存盘 M 文件的执行 1 从 MATLAB 主窗口的 debug 菜单选择 Run 菜单项 2 单击 MATLAB 主窗口工具栏上的 Run 按钮 2 format rat 页 36 N 1 2 3 4 5 A 2 N B N 2 C 1 N D 1 N N 3 B 0 A rand 1 20 for i 1 20 A i fix 99 10 1 rand 1 10 B A i B end A 页 37 B B 20 for i 1 20 if A i x y z sphere 20 surf x y z 页 50 axis off shading interp m moviein 20 for i 1 20 axis i i i i i i m i getframe end movie m 4 页 51 二 思考练习 1 plot 函数的输入参数是矩阵形式 含多个输入参数的 plot 函数 具有两个纵坐标标度的图形 图形保持 2 绘制下列曲线 1 页 52 2 页 53 3 在同一坐标轴中绘制下列两条曲线并标注两曲线交叉点 1 y 2x 0 5 x sin 3t cost 2 0 t y sin 3t sint 页 54 页 55 4 分别用 plot 和 fplot 函数绘制函数 y sin 1 x 的曲线 分析两曲线的差别 页 56 5 绘制下列极坐标图 1 12 页 57 2 66 cossin cossin3 33 a 页 58 6 绘制曲面图形 x 3usinv 1 y 2ucosv z 4u2 页 59 2 3 3 1 5 22 yx yx yxf 页 60 5 数据分析与多项式计算实验 一 实验内容 1 利用 MATLAB 提供的 randn 函数生成符合正态分布的 10 5 随即矩阵 A 进行以下操作 1 A 格列元素的均值和标准方差 页 61 2 A 的最大元素和最小元素 3 求 A 每行元素的和以及全部元素之和 页 62 4 分别对 A 的每列元素按升序 每行元素按降序排序 A randn 10 5 sort A ans 1 6636 1 6640 1 2566 1 5175 1 4095 1 2705 1 3335 1 1746 0 5478 1 1190 0 7036 0 7121 1 0290 0 2454 0 5803 0 2747 0 5412 1 0211 0 0097 0 2576 0 1331 0 2640 0 9414 0 0714 0 0132 0 2189 0 2494 0 4017 0 2608 0 3255 0 2617 0 0113 0 3472 0 3165 0 6204 0 2809 0 0008 0 1161 0 4998 1 2698 0 9901 0 3966 0 1737 1 0641 1 7701 页 63 1 2134 1 0727 0 2431 1 2781 2 1363 sort A 2 descend ans 1 0641 0 9901 0 0132 0 5412 1 0290 0 2431 0 2189 0 2454 0 5803 1 3335 2 1363 1 0727 0 2617 1 2566 1 5175 1 2134 0 0097 0 2576 0 3472 0 7121 0 0714 0 0113 0 2747 0 9414 1 4095 1 7701 0 3165 0 0008 0 1331 1 1746 0 4998 0 3255 0 2494 1 0211 1 2705 1 2781 0 3966 0 4017 1 1190 1 6636 0 6204 0 1737 0 2640 0 5478 0 7036 1 2698 0 2809 0 2608 0 1161 1 6640 2 1 3 次样条插值 t 0 15 90 x1 0 0 2588 0 5000 0 7071 0 8660 0 9659 1 0000 a1 0 1 90 y1 interp1 t x1 a1 spline y1 页 64 Columns 1 through 6 0 0 0175 0 0349 0 0524 0 0698 0 0872 Columns 7 through 12 0 1045 0 1219 0 1392 0 1564 0 1737 0 1908 Columns 13 through 18 0 2079 0 2249 0 2419 0 2588 0 2756 0 2923 Columns 19 through 24 0 3090 0 3255 0 3420 0 3583 0 3746 0 3907 Columns 25 through 30 0 4067 0 4226 0 4384 0 4540 0 4695 0 4848 Columns 31 through 36 页 65 0 5000 0 5150 0 5299 0 5446 0 5592 0 5736 Columns 37 through 42 0 5878 0 6018 0 6157 0 6293 0 6428 0 6561 Columns 43 through 48 0 6691 0 6820 0 6947 0 7071 0 7193 0 7313 Columns 49 through 54 0 7431 0 7547 0 7660 0 7771 0 7880 0 7986 Columns 55 through 60 0 8090 0 8191 0 8290 0 8387 0 8480 0 8571 Columns 61 through 66 0 8660 0 8746 0 8829 0 8910 0 8987 0 9062 页 66 Columns 67 through 72 0 9135 0 9204 0 9271 0 9335 0 9396 0 9454 Columns 73 through 78 0 9510 0 9563 0 9612 0 9659 0 9703 0 9744 Columns 79 through 84 0 9782 0 9817 0 9849 0 9878 0 9904 0 9927 Columns 85 through 90 0 9946 0 9963 0 9977 0 9987 0 9995 0 9999 Column 91 1 0000 x1 0 0 2588 0 5000 0 7071 0 8660 0 9659 1 0000 a1 0 1 90 页 67 y1 interp1 t x1 a1 spline y2 Columns 1 through 6 0 0 0184 0 0365 0 0545 0 0724 0 0902 Columns 7 through 12 0 1079 0 1255 0 1431 0 1607 0 1784 0 1961 Columns 13 through 18 0 2138 0 2317 0 2497 0 2679 0 2863 0 3048 Columns 19 through 24 0 3236 0 3427 0 3620 0 3817 0 4017 0 4221 Columns 25 through 30 0 4429 0 4641 0 4858 0 5079 0 5305 0 5537 页 68 Columns 31 through 36 0 5774 0 6017 0 6266 0 6520 0 6780 0 7046 Columns 37 through 42 0 7317 0 7593 0 7876 0 8163 0 8456 0 8754 Columns 43 through 48 0 9058 0 9367 0 9681 1 0000 1 0325 1 0658 Columns 49 through 54 1 1003 1 1364 1 1743 1 2145 1 2572 1 3028 Columns 55 through 60 1 3516 1 4041 1 4604 1 5211 1 5863 1 6565 Columns 61 through 66 页 69 1 7320 1 8131 1 9002 1 9936 2 0937 2 2008 Columns 67 through 72 2 3152 2 4374 2 5675 2 7060 2 8532 3 0095 Columns 73 through 76 3 1752 3 3506 3 5361 3 7320 5 次多项式拟合 t 0 15 90 x1 0 0 2588 0 5000 0 7071 0 8660 0 9659 1 0000 p1 polyfit t x1 5 z1 polyval p1 a1 z1 Columns 1 through 6 0 0000 0 0174 0 0349 0 0523 0 0697 0 0871 页 70 Columns 7 through 12 0 1045 0 1218 0 1391 0 1564 0 1736 0 1908 Columns 13 through 18 0 2079 0 2249 0 2419 0 2588 0 2756 0 2924 Columns 19 through 24 0 3090 0 3256 0 3420 0 3584 0 3746 0 3907 Columns 25 through 30 0 4067 0 4226 0 4384 0 4540 0 4695 0 4848 Columns 31 through 36 0 5000 0 5150 0 5299 0 5446 0 5592 0 5736 Columns 37 through 42 页 71 0 5878 0 6018 0 6157 0 6293 0 6428 0 6561 Columns 43 through 48 0 6691 0 6820 0 6946 0 7071 0 7193 0 7313 Columns 49 through 54 0 7431 0 7547 0 7660 0 7771 0 7880 0 7986 Columns 55 through 60 0 8090 0 8191 0 8290 0 8386 0 8480 0 8571 Columns 61 through 66 0 8660 0 8746 0 8829 0 8910 0 8988 0 9063 Columns 67 through 72 0 9135 0 9205 0 9272 0 9336 0 9397 0 9455 页 72 Columns 73 through 78 0 9510 0 9563 0 9612 0 9659 0 9703 0 9743 Columns 79 through 84 0 9781 0 9816 0 9848 0 9877 0 9902 0 9925 Columns 85 through 90 0 9945 0 9962 0 9975 0 9986 0 9994 0 9998 Column 91 1 0000 t 0 15 75 x2 0 0 2679 0 5774 1 0000 1 7320 3 7320 p2 polyfit t x2 5 z2 polyval p2 a2 z2 页 73 Columns 1 through 6 0 0000 0 0235 0 0454 0 0658 0 0850 0 1032 Columns 7 through 12 0 1206 0 1375 0 1540 0 1701 0 1862 0 2022 Columns 13 through 18 0 2183 0 2345 0 2511 0 2679 0 2851 0 3028 Columns 19 through 24 0 3208 0 3394 0 3585 0 3781 0 3982 0 4188 Columns 25 through 30 0 4400 0 4616 0 4838 0 5065 0 5297 0 5533 Columns 31 through 36 页 74 0 5774 0 6020 0 6270 0 6524 0 6783 0 7047 Columns 37 through 42 0 7315 0 7588 0 7867 0 8150 0 8440 0 8736 Columns 43 through 48 0 9039 0 9351 0 9670 1 0000 1 0341 1 0693 Columns 49 through 54 1 1060 1 1442 1 1841 1 2259 1 2699 1 3162 Columns 55 through 60 1 3652 1 4171 1 4723 1 5310 1 5935 1 6604 Columns 61 through 66 1 7320 1 8087 1 8910 1 9793 2 0742 2 1762 页 75 Columns 67 through 72 2 2860 2 4040 2 5310 2 6677 2 8147 2 9727 Columns 73 through 76 3 1427 3 3253 3 5214 3 7320 2 n 1 4 9 16 25 36 49 64 81 100 N sqrt n x input 请输入想计算的值 interp1 n N x cubic 请输入想计算的值 67 ans 8 1855 3 N 64 T 5 t linspace 0 T N h exp t dt t 2 t 1 f 1 dt H fft h F H 1 N 2 1 f f 0 N 2 N 页 76 plot f abs F xlabel Frequency ylabel F k 4 P 2 3 0 5 13 Q 1 5 8 p polyder P p 页 77 8 9 0 5 p1 polyder P Q p1 12 35 4 57 76 105 p q polyder P Q p 4 27 34 77 26 25 q 1 10 41 80 64 5 P1 1 2 4 0 5 P2 0 1 2 P3 1 2 3 页 78 P4 conv P2 P3 P4 0 1 4 7 6 P P1 P4 P 1 3 8 7 11 x roots P x 1 3840 1 8317i 1 3840 1 8317i 0 1160 1 4400i 0 1160 1 4400i A 1 1 2 1 4 0 75 2 3 5 0 5 2 5 Y polyder P A 页 79 Y Columns 1 through 6 12 0000 24 7500 57 5000 1 8000 1 2000 201 9500 Columns 7 through 12 228 0000 332 5000 235 2000 242 1000 58 2000 56 0000 Z polyvalm P A Z 1 0e 003 0 0076 0 1281 0 0775 0 1328 1 3900 1 1644 0 1824 1 7364 1 5198 页 80 二 思考练习 1 sum 是数据序列求和 cumsum 是求向量和矩阵元素的累加和 2 数据插值 在离散数据的基础上补插连续函数 使得这条连续曲线通过 全部给定的离散数据点 插值是离散函数逼近的重要方法 利用它可通过函 数在有限个点处的取值状况 估算出函数在其他点处的近似值 曲线拟合是指用连续曲线近似地刻画或比拟平面上离散点组所表示的坐标之 间的函数关系 3 在 MATLAB 中 n 次多项式用一个长度为 n 1 的行向量表示 缺少的幂 次项系数为 0 如果 次多项式表示为 P x a0 xn a1xn 1 a2xn 2 an 1x an则在 MATLAB 中 P x 表达为向量形 式 a0 a1 a2 an 1 an 4 c 0 for i 1 30000 a i rand 1 if a i 0 5 c c 1 end end b mean a b 0 5026 b std a 0 2 页 81 b 0 2899 b max a b 1 0000 b min a b 1 5584e 005 c 30000 ans 0 5045 5 P fix 100 0 1 rand 5 100 页 82 b c max P 2 b c min P 2 mean P 2 std P 0 2 b c sort P 2 descend zcj sum P 1 xsxh 1 100 6 t 1 10 101 x 0 1 0414 1 3222 1 4914 1 6128 1 7076 1 7853 1 8513 1 9085 1 959 0 2 0043 a 1 1 101 p polyfit t x 5 z polyval x a plot t x o a z 页 83 6 解方程与最优化求解实验 一 实验内容 1 A 1 2 1 3 1 4 1 3 1 4 1 5 1 4 1 5 1 6 p 0 95 0 67 0 52 x A p cond A x 页 84 1 2000 0 6000 0 6000 x 3 0000 6 6000 6 6000 ans 1 3533e 003 2 1 x1 fzero funx1 1 function fx funx1 x fx x 41 x 3 1 2 x2 fzero funx2 0 5 function fx funx2 x fx x sin x x 3 options optimset Display off x fsolve fun3 1 1 1 options q fun3 x function q fun3 p x p 1 页 85 y p 2 z p 3 q 1 sin x y 2 log z 7 q 2 3 x 2 y z 3 1 q 3 x y z 5 3 1 t0 0 tf 5 y0 1 t y ode23 fun4 t0 tf y0 t y function yp fun4 t y yp 1 2 sin 10 t y 2 t0 0 tf 5 y0 1 t y ode23 fun5 t0 tf y0 t y function yp fun5 t y yp cos t y 1 t 2 页 86 4 x fminbnd mymin 0 2 mymin x function fx mymin x fx 1 x 2 1 x 4 5 options optimset Display off x fval fmincon fun6 0 0 0 a b lb ub fval function f fun6 x f sqrt x 1 400 x 1 1 1 sqrt x 2 400 x 1 1 1 x 2 1 1 sqrt 3 400 x 1 1 1 x 2 1 1 x 3 1 1 sqrt x x4 二 思考练习 1 1 A 2 3 5 3 7 4 1 7 1 B 10 3 5 C1 inv A B C2 A B L U lu A x U L B C1 1 8060 0 5373 页 87 3 0448 C2 1 8060 0 5373 3 0448 x 1 8060 0 5373 3 0448 2 A 6 5 2 5 9 1 4 1 3 4 2 2 3 9 0 2 B 4 13 1 11 C1 inv A B C2 A B L U lu A x U L B C1 0 6667 1 0000 1 5000 0 0000 C2 0 6667 页 88 1 0000 1 5000 0 0000 x 0 6667 1 0000 1 5000 0 0000 2 1 x1 fzero funx1 1 5 function fx funx1 x fx 3 x sin x exp x 2 x1 fzero funx2 1 function fx funx2 x fx x 1 x 5 3 options optimset Display off x fsolve fun3 3 0 options q fun3 x function q fun3 p x p 1 页 89 y p 2 q 1 x 2 y 2 9 q 2 x y 1 3 1 t0 0 tf 5 y0 0 1 t y ode45 vdpol t0 tf y0 t y function ydot vdpol t y ydot 1 2 3 y 2 2 t y 1 1 t 2 ydot 2 y 1 ydot ydot 2 t0 0 tf 5 y0 1 0 2 t y ode45 vdpoll t0 tf y0 t y function ydot vdpoll t y ydot 1 cos t y 3 3 sin t 5 y 1 cos 2 t t 1 2 y 2 ydot 2 y 1 页 90 ydot 3 y 2 ydot ydot 4 x fminbnd mymin 0 pi mymin x function fx mymin x fx sin x cos x 2 5 x y1 fminbnd mymax 0 1 5 y1 function fx mymax x fx 9 x 4 x 3 12 x 2 7 数值运算实验 一 实验内容 1 1 format long fx inline sin x x I n quadl fx 0 2 1e 10 I 1 60541297679358 n 页 91 19 2 format long fx inline 1 x 0 3 2 0 01 1 x 0 9 2 0 04 6 I n quad fx 0 1 1e 10 I 11 70057549628952 n 985 2 1 f inline e x 2 y 2 x y I dblquad f 0 1 0 1 2 f inline abs cos x y x y I dblquad f 0 pi 0 pi I 6 28318893772326 3 X 0 3 0 2 1 5 F 0 3895 0 6598 0 9147 1 1611 1 3971 1 6212 1 8325 trapz X F ans 1 37298000000000 页 92 4 p 0 pi 5 2 pi for n 1 3 n DX diff sin p n end n 1 DX Columns 1 through 5 0 58778525229247 0 36327126400268 0 00000000000000 0 36327126400268 0 58778525229247 Columns 6 through 10 0 58778525229247 0 36327126400268 0 00000000000000 0 36327126400268 0 58778525229247 n 2 DX Columns 1 through 5 0 22451398828979 0 36327126400268 0 36327126400268 0 22451398828979 0 Columns 6 through 9 0 22451398828979 0 36327126400268 0 36327126400268 0 22451398828979 n 页 93 3 DX Columns 1 through 5 0 13875727571289 0 00000000000000 0 13875727571289 0 22451398828979 0 22451398828979 Columns 6 through 8 0 13875727571289 0 0 13875727571289 5 f inline sin x x cos 2 x g inline cos x x cos 2 x sin x 1 2 sin 2 x x cos 2 x 2 x pi 0 01 pi p polyfit x f x 5 dp polyder p dpx polyval dp x 求 dp 在假设点的函数值 dx diff f x 3 01 0 01 直接对 f x 求数值导数 gx g x 求函数 f 的导函数 g 在假设点的导数 plot x dpx x dx x gx 作图 页 94 二 思考练习 1 数值积分 1 变步长辛普生法 I n quad fname a b tol trace I n quadl fname a b tol trace 2 高斯 克朗罗德法 I err quadgk fname a b 3 梯形积分法 I trapz X Y 数值微分 第一种是用多项式或样条函数 g x 对 f x 进行逼近 插值或拟合 然后用逼近函数 g x 在点 x 处的导数作为 f x 在点 x 处的导数 第二种是 用 f x 在点 x 处的某种差商作为其导数 计算向前差分的函数 diff 调用格式 1 DX diff X 2 DX diff X n 3 DX diff A n dim 1 format long fx inline 1 1 x 2 I n quad fx Inf Inf 1e 10 页 95 I n quadl fx Inf Inf 1e 10 x 100000 100000 y 1 1 x 2 trapz x y format short I NaN n 13 I NaN n 18 ans 3 15332809493716 3 1 format long fx inline log 1 x 1 x 2 I n quad fx 0 1 1e 10 I 0 27219826128863 n 页 96 109 2 format long fx inline sqrt cos t 2 4 sin 2 t 2 1 I n quad fx 0 2 pi 1e 10 I 6 008624072668 4 11280905652400i n 10013 4 f inline 4 x z exp z 2 y x 2 I triplequad f 0 pi 0 pi 0 1 I 1 73276227351559 5 f inline sin x g inline cos x x 0 0 01 2 pi p polyfit x f x 5 dp polyder p dpx polyval dp x dx diff f x 2 pi 0 01 0 01 gx g x plot x dpx x dx x gx 页 97 8 符号实验 一 实验内容 1 syms x y s x 4 y 4 factor s factor 5135 ans x y x y x 2 y 2 ans 5 13 79 2 1 syms x f x 2 x 2 4 limit f x 2 页 98 ans 1 4 2 2 sym x f sqrt pi sqrt acos x sqrt x 1 limit f x 1 right ans Inf 3 1 sym x f sin 1 x diff f x diff f x 2 ans cos 1 x x 2 ans sin 1 x x 4 2 cos 1 x x 3 3 2 sym x f 1 cos 2 x x diff f x diff f x 2 页 99 ans 2 sin 2 x x 1 cos 2 x x 2 ans 4 cos 2 x x 4 sin 2 x x 2 2 1 cos 2 x x 3 4 1 sym x f sqrt exp x 1 int f x ans 2 exp x 1 1 2 log exp x 1 1 2 1 log exp x 1 1 2 1 4 2 syms x y f x x y int f y ans x log x y 4 3 sym x f exp x 1 exp x 2 int f x 0 log 2 ans 页 100 7 3 exp 6243314768165359 9007199254740992 exp 62433147681653 59 9007199254740992 2 1 3 exp 6243314768165359 900719925474 0992 3 4 4 sym x f x log x int f x 1 exp 1 ans 9366741398929500034245406117369 253530120045645880299340 6410752 log 3060513257434037 234168534973237500856135152934225 12676506002282294014967032 05376 log 2 8099090798701270632748702911993 5070602400912917605986812821 504 5 1 sym x s symsum 1 x 1 x 1 Inf s log 2 2 sym y z symsum y 2 y 1 2 y 1 1 Inf z sum y 2 y 1 2 y 1 y 1 Inf 页 101 6 sym x f1 exp x exp x 2 f2 sqrt x 3 2 x 1 taylor f1 x 5 0 taylor f2 x 6 0 ans 1 1 2 x 2 1 24 x 4 ans 1 x 1 2 x 2 1 8 x 4 1 8 x 5 7 syms x y a x solve x 3 a x 1 0 x x solve sin x 2 cos x sqrt x 0 x x y solve log x y 9 exp x y 3 x y x 1 6 108 12 12 a 3 81 1 2 1 3 2 a 108 12 12 a 3 81 1 2 1 3 1 12 108 12 12 a 3 81 1 2 1 3 a 108 12 12 a 3 81 1 2 1 3 1 2 i 3 1 2 1 6 108 12 12 a 3 81 1 2 1 3 2 a 108 12 12 a 3 81 1 2 1 3 1 12 108 12 12 a 3 81 1 2 1 3 a 108 12 12 a 3 81 1 2 1 3 1 2 i 3 1 2 1 6 108 12 12 a 3 81 1 2 1 3 2 a 108 12 12 a 3 81 1 2 1 3 页 102 x 71838263355891492229146349786538 0 i x exp 9 log 3 exp 9 1 y log 3 exp 9 1 8 二 思考练习 2 syms x B1 B2 a b s1 2 cos x 2 sin x 2 s2 sin B1 cos B2 cos B1 sin B2 s3 sqrt a sqrt a 2 b 2 sqrt a sqrt a 2 b 2 s4 4 x 2 8 x 3 2 x 1 h1 simplify s1 h2 simplify s2 h3 simplify s3 h4 simplify s4 h1 3 cos x 2 1 h2 sin B1 B2 页 103 h3 2 1 2 a a 2 b 1 2 1 2 a a 2 b 1 2 1 2 2 h4 2 x 3 3 1 syms x a f abs x x limit f x 0 left ans 1 2 f x a x x limit f x inf ans Inf 4 1 syms x y m f sqrt x sqrt x sqrt x m diff f x diff m x m 1 2 x 1 2 1 2 x x 1 2 1 2 1 2 x x x 1 2 1 2 1 2 ans 1 2 x 1 2 1 2 x x 1 2 1 2 1 2 4 x x x 1 2 1 2 3 2 1 8 x 3 2 x x 1 2 1 2 页 104 1 2 x 1 2 1 2 4 x x 1 2 3 2 2 x x x 1 2 1 2 1 2 2 syms x y f x y sqrt x 2 y 2 z1 diff f x z2 diff f y z1 1 x x 2 y 2 1 2 z2 1 y x 2 y 2 1 2 5 1 syms x f sin x int f ans cos x 2 sym x f 1 asin x 2 1 x 2 1 2 int f ans 1 asin x 1 1 syms x f 1 1 x 页 105 int f 0 4 ans log 5 2 sym x f x 3 sin x 2 x 6 2 x 4 1 int f 1 1 ans int x 3 sin x 2 x 6 2 x 4 1 x 1 1 7 1 syms n s symsum 1 4 n 1 inf s 1 3 2 sym n s symsum n 1 n 1 2 1 inf eval y s sum n 1 n 1 2 n 1 Inf ans Y 8 1 syms x f tan x taylor f x 3 页 106 ans tan 3 tan 3 tan 3 3 x 3 2 tan 3 2 1 x 3 x 3 5 tan 3 2 tan 3 15 tan 3 tan 3 2 3 tan 3 tan 3 3 tan 3 3 tan 3 3 3 2 tan 3 2 3 tan 3 tan 3 3 tan 3 3 2 15 x 3 3 tan 3 2 tan 3 tan 3 3 tan 3 3 1 3 x 3 4 2 tan 3 3 tan 3 tan 3 2 3 tan 3 tan 3 3 tan 3 3 tan 3 3 2 syms x f sin x 2 taylor f x 5 ans sin 5 2 2 cos 5 sin 5 x 5 4 cos 5 sin 5 x 5 3 3 2 cos 5 2 sin 5 2 sin 5 3 x 5 2 2 sin 5 4 cos 5 2 sin 5 3 4 sin 5 3 3 x 5 4 4 sin 5 x 5 5 4 cos 5 sin 5 2 3 cos 5 2 cos 5 2 sin 5 2 sin 5 3 3 sin 5 cos 5 4 cos 5 2 sin 5 3 4 sin 5 3 3 2 sin 5 5 sin 5 9 1 syms x x solve log 1 x 5 1 sin x 2 x x 521 67926389905
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年文化娱乐行业消费者行为洞察:细分市场趋势分析与策略布局报告
- 2025年事业单位工勤技能-湖北-湖北房管员一级(高级技师)历年参考题库含答案解析
- 2025-2030中国纳豆激酶市场需求量格局与销售渠道分析报告
- 2025年事业单位工勤技能-湖北-湖北假肢制作装配工五级(初级工)历年参考题库含答案解析
- 文化遗产数字化保护与利用技术在我国文化遗产保护领域的应用现状与对策报告
- 2025年区块链在跨境支付中的跨境支付跨境支付技术跨境支付技术法规解读报告
- 2025年事业单位工勤技能-河北-河北中式烹调师一级(高级技师)历年参考题库含答案解析(5套)
- 2025年事业单位工勤技能-广西-广西计量检定工五级(初级工)历年参考题库含答案解析
- 2025年事业单位工勤技能-广西-广西无损探伤工四级(中级工)历年参考题库含答案解析
- 2025年事业单位工勤技能-广东-广东食品检验工一级(高级技师)历年参考题库含答案解析
- 担保合同与保证合同(标准版)
- 沉浸式戏剧市场推广渠道创新与2025年策略研究报告
- 银行招聘考试试题及答案(类似竞赛题型部分)
- 加盟合同协议书范本模板模板
- 医院节能培训课件模板
- 2025年初级工程测量员考试试题(附答案)
- 民族文化宫2024年度面向应届毕业生和社会人员公开招聘笔试模拟试题及参考答案详解一套
- 2025低空经济发展及关键技术概况报告
- 学堂在线 经济学原理 章节测试答案
- 2025年湖北省宜昌市【辅警协警】笔试模拟考试(含答案)
- 2025学校“三重一大”事项集体决策制度及会议记录
评论
0/150
提交评论