已阅读5页,还剩18页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
2009 4 131 Computer Simulation s 1 while s 2000 n n 1 s s n end n 1 验证程序 验证程序 s 1 for i 2 62 s s i end s s 1953 若改成函数文件呢 若改成函数文件呢 例 任意参数例 任意参数SUM 编写函数 文件 编写函数 文件my max sum 求出使 求出使 1 2 n SUM的的n值值 2009 4 135 Computer Simulation for i n1 n2 sum sum 2 i end 调用方法 调用方法 Sum mysum 0 15 s 65535 用用while循环循环 sum 0 i n1 while i 0 else y 0 end 01 2 12 0 xx f xxx others 3 2 fff 调用方法 调用方法 ff 3 0 ff sqrt 2 0 5858 ff inf 0 2009 4 138 Computer Simulation end sum 0 for i 1 2 2 n 1 sum sum i end 调用方法 调用方法 sum mysum2 N 1 2 3 Sum 4 9 16 2009 4 139 Computer Simulation plot t f title f t Sa t xlabel t axis 10 10 0 4 1 1 2009 4 1310 Computer Simulation y 3 sin 2 pi 50 t plot t 1 50 y 1 50 t 0 0 001 50 y sin 2 pi 50 t s y randn size t plot t 1 50 s 1 50 2009 4 1311 Computer Simulation y square 2 pi 30 t plot t 1 50 y 1 50 t 0 0 001 2 5 y sawtooth 2 pi 30 t plot t y axis 0 0 2 1 1 2009 4 1312 Computer Simulation y1 sinc t Subplot 121 plot t y1 y2 sin t t Subplot 122 plot t y2 y1 sin pi t pi t 2009 4 1313 Computer Simulation ezplot sin pi 4 t 16 16 2009 4 1315 Computer Simulation f sin pi 4 t 例 例 a 1 b 2 c 1 f x a x 2 b x c ezplot f 例 a pi b 15 f x y a x b y ezsurf f 例 f x x 2 g x 3 x h x g f x h 3 2009 4 1316 Computer Simulation fplot x f x 10 0 2 pi 2009 4 1318 Computer Simulation c 1 5 define parameter first x fminbnd x myfun x c 0 1 2009 4 1319 Computer Simulation c 2 define parameter first x fzero x myfun x c 0 1 2009 4 1320 Computer Simulation where myfun m is the M file function function y myfun x y 1 x 3 2 x 5 2009 4 1321 Computer Simulation y i quad humps 0 x i end plot x y 2009 4 1322 Computer Simulation ApplicationComputer Simulation Application 本课小结本课小结 读写文件 设置路径等读写文件 设置路径等 编程方法编程方法 任意函数的定义方法任意函数的定义方法 函数库函数库 2009 4 1323 Computer Simulation ApplicationCom
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 小学一年级语文教学设计《语文园地八》分层作业实践与研究
- 初中七年级语文《世说新语》二则之陈太丘与友期行教学设计
- 物流a2司机招聘考试题及答案
- 钢琴基础考试卷(含答案)
- 网络社交活动管理指南
- 初中生物2026教资面试历年真题强化训练
- 高中历史教资面试教资面试历年真题试卷及答案
- 20261124-141716-希尔顿模板课件
- 小学三年级科学《植物的生长变化》教学设计
- 小学三年级书法教学设计:两横并排的笔势与呼应
- 污水管道检查井施工工艺
- 酒店pA公共区域卫生管理制度
- 弘扬伟大奋斗精神 建功立业新时代
- 2026年党务工作者业务能力提升试题及答案
- 大学班级年度工作总结与考试反思
- 南开大学课件
- 2025届贵州省中考真题化学试卷(含答案)
- 鼻科内镜诊疗技术管理规范
- 边防大队考试题库及答案
- 自建房装模板合同协议
- 通站(2017)8012 铁路站场排水构筑物
评论
0/150
提交评论