没有合适的资源?快使用搜索试试~ 我知道了~
面向工科学生的MATLAB简介.pdf
资源推荐
资源详情
资源评论
INTRODUCTION
TO
MATLAB
FOR
ENGINEERING
STUDENTS
Contents
1 Tutorial lessons 1 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Basic features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 A minimum MATLAB session . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3.1 Starting MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3.2 Using MATLAB as a calculator . . . . . . . . . . . . . . . . . . . . . 4
1.3.3 Quitting MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4.1 Creating MATLAB variables . . . . . . . . . . . . . . . . . . . . . . . 5
1.4.2 Overwriting variable . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4.3 Error messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4.4 Making corrections . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4.5 Controlling the hierarchy of operations or precedence . . . . . . . . . 6
1.4.6 Controlling the appearance of floating point number . . . . . . . . . . 8
1.4.7 Managing the workspace . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4.8 Keeping track of your work session . . . . . . . . . . . . . . . . . . . 9
1.4.9 Entering multiple statements per line . . . . . . . . . . . . . . . . . . 9
1.4.10 Miscellaneous commands . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4.11 Getting help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2 Tutorial lessons 2 12
2.1 Mathematical functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.1.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
i
2.2 Basic plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.1 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.2 Creating simple plots . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.3 Adding titles, axis labels, and annotations . . . . . . . . . . . . . . . 15
2.2.4 Multiple data sets in one plot . . . . . . . . . . . . . . . . . . . . . . 16
2.2.5 Specifying line styles and colors . . . . . . . . . . . . . . . . . . . . . 17
2.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.4 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.5 Matrix generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.5.1 Entering a vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.5.2 Entering a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.5.3 Matrix indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.5.4 Colon operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5.5 Linear spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5.6 Colon operator in a matrix . . . . . . . . . . . . . . . . . . . . . . . . 22
2.5.7 Creating a sub-matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.5.8 Deleting row or column . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.5.9 Dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.5.10 Continuation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.5.11 Transposing a matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.5.12 Concatenating matrices . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.5.13 Matrix generators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.5.14 Special matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3 Array operations and Linear equations 30
3.1 Array operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.1 Matrix arithmetic operations . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.2 Array arithmetic operations . . . . . . . . . . . . . . . . . . . . . . . 30
3.2 Solving linear equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.2.1 Matrix inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
ii
3.2.2 Matrix functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.3 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4 Introduction to programming in MATLAB 35
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.2 M-File Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.2.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.2.2 Script side-effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.3 M-File functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.3.1 Anatomy of a M-File function . . . . . . . . . . . . . . . . . . . . . . 38
4.3.2 Input and output arguments . . . . . . . . . . . . . . . . . . . . . . . 40
4.4 Input to a script file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.5 Output commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5 Control flow and operators 43
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.2 Control flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.2.1 The ‘‘if...end’’ structure . . . . . . . . . . . . . . . . . . . . . . . 43
5.2.2 Relational and logical operators . . . . . . . . . . . . . . . . . . . . . 45
5.2.3 The ‘‘for...end’’ loop . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2.4 The ‘‘while...end’’ loop . . . . . . . . . . . . . . . . . . . . . . . 46
5.2.5 Other flow structures . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.2.6 Operator precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.3 Saving output to a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
6 Debugging M-files 49
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.2 Debugging process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
6.2.1 Preparing for debugging . . . . . . . . . . . . . . . . . . . . . . . . . 50
6.2.2 Setting breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
iii
6.2.3 Running with breakpoints . . . . . . . . . . . . . . . . . . . . . . . . 50
6.2.4 Examining values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.2.5 Correcting and ending debugging . . . . . . . . . . . . . . . . . . . . 51
6.2.6 Ending debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
6.2.7 Correcting an M-file . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
A Summary of commands 53
B Release notes for Release 14 with Service Pack 2 58
B.1 Summary of changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
B.2 Other changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
B.3 Further details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
C Main characteristics of MATLAB 62
C.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
C.2 Strengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
C.3 Weaknesses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
C.4 Competition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
iv
剩余71页未读,继续阅读
资源评论
珞瑜·
- 粉丝: 10w+
- 资源: 500
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (大赛作品)STM32实现的F072RB NUCLEO智能家居控制.zip
- STM32实现的数字示波器源码+数字信号处理教程、配套实例.zip
- 【cookie续续】【cookie续续】【cookie续续】
- 低功耗STM32实现的F411开发板(原理图+PCB源文件+官方例程+驱动等).zip
- 基于stm32实现的 nucleo-L476的智能灯(操作说明+源码).zip
- 基于STM32实现的 NUCLEO板设计彩色LED照明灯(纯cubeMX开发).zip
- 基于STM32实现的 的联合调试侦听设备解决方案(原理图、PCB源文件、调试工具、视频).zip
- 基于STM32实现的 人群定位、调速智能风扇设计(程序、设计报告、视频演示).zip
- 哔哩下载姬(DownKyi)
- 千纬认字app再次更新,增加部首、笔画动画功能
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功