关于我们
书单推荐
新书推荐
|
MATLAB R2020a入门、精通与实战 读者对象:本书可以作为信号处理、自动控制、机械电子、自动化、电力电气、通信工程等专业的教学用书,也以作为通信、电子、自动控制等领域的广大科研工作者、工程师等的自学参考用书。
MATLAB是 MathWorks公司推出的高性能数值计算和可视化软件,它集数值计算、矩阵运算和图形可视化于一体,方便地应用于算法开发、数据采集、数学建模、科学计算、系统仿真、数据分析等方面。本书基于R2020a版本,由浅入深且系统地介绍了MATLAB应用。全书共13章,内容涉及初识MATLAB、基础知识、向量与矩阵、矩阵运算、数学函数、数据绘图、图形处理、程序设计、数值计算、符号计算、句柄图形、输入与输出、 Simulink仿真。全书语言通俗易懂,内容丰富翔实;突出以实例为中心的特点,通过大量的实例,实现理论与实践的结合,可以帮助读者快速、轻松地掌握 MATLAB。
刘浩,男,毕业于天津工业大学。04年获得Adobe系列产品专家证书,ACCD平面设计师证书,CEAC国家信息产业平面设计师证书。上海碧海金沙设计总监,上海Nordri设计工作室(上海诺睿网络信息科技有限公司)创始人兼任设计总监,北京拓扑人咨询高级顾问,wps office签约讲师,复旦MBA港大项目组签约讲师。
第1 章 初识MATLAB ····································································································.1
1.1 MATLAB 的工作环境 ······························································································.2 1.1.1 操作界面 ·····································································································.2 1.1.2 当前文件夹窗口 ····························································································.2 1.1.3 命令行窗口 ··································································································.3 1.1.4 工作区窗口 ··································································································.5 1.2 通用命令 ··············································································································.6 1.2.1 常用命令 ·····································································································.6 1.2.2 快捷键 ········································································································.6 1.2.3 标点符号的含义 ····························································································.7 1.3 搜索路径设置 ········································································································.7 1.4 MATLAB 的帮助系统 ······························································································.9 1.4.1 使用帮助命令 ·······························································································.9 1.4.2 帮助导航系统 ·····························································································.10 1.4.3 示例程序的帮助系统 ····················································································.11 1.5 MATLAB 示例 ·····································································································.11 1.6 本章小结 ············································································································.12 第2 章 基础知识 ···········································································································.13 2.1 基本概念 ············································································································.14 2.1.1 常量和变量 ································································································.15 2.1.2 数组、矩阵、标量与向量 ··············································································.15 2.1.3 命令与函数 ································································································.16 2.1.4 表达式与语句 ·····························································································.17 2.2 数据类型 ············································································································.17 2.2.1 数值类型 ···································································································.18 2.2.2 逻辑类型 ···································································································.20 2.2.3 字符和字符串 ·····························································································.20 2.2.4 结构体类型 ································································································.20 2.2.5 单元数组类型 ·····························································································.23 MATLAB R2020a 入门、精通与实战 VI 2.2.6 函数句柄 ···································································································.24 2.3 运算符 ···············································································································.25 2.3.1 算术运算符 ································································································.25 2.3.2 关系运算符 ································································································.26 2.3.3 逻辑运算符 ································································································.27 2.3.4 运算优先级 ································································································.28 2.4 字符串 ···············································································································.29 2.4.1 字符串的构造 ·····························································································.29 2.4.2 字符串的比较 ·····························································································.31 2.4.3 字符串查找和替换函数 ·················································································.32 2.4.4 字符串与数值的转换 ····················································································.32 2.5 本章小结 ············································································································.33 第3 章 向量与矩阵 ········································································································.34 3.1 向量 ··················································································································.35 3.1.1 创建向量 ···································································································.35 3.1.2 向量的加减乘除运算 ····················································································.36 3.1.3 向量的点积和叉积运算 ·················································································.37 3.2 矩阵 ··················································································································.38 3.2.1 矩阵的构造 ································································································.38 3.2.2 矩阵的拓展与裁剪 ·······················································································.39 3.2.3 矩阵下标引用 ·····························································································.42 3.2.4 矩阵信息的获取 ··························································································.43 3.2.5 矩阵结构的改变 ··························································································.44 3.3 稀疏矩阵 ············································································································.45 3.3.1 创建和查看稀疏矩阵 ····················································································.45 3.3.2 稀疏矩阵的运算规则 ····················································································.46 3.4 本章小结 ············································································································.47 第4 章 矩阵运算 ···········································································································.48 4.1 矩阵分析 ············································································································.49 4.1.1 范数 ·········································································································.49 4.1.2 矩阵的秩 ···································································································.50 4.1.3 矩阵的行列式 ·····························································································.50 4.1.4 矩阵的迹 ···································································································.51 4.1.5 矩阵的正交空间 ··························································································.51 4.1.6 矩阵的化零矩阵 ··························································································.51 4.1.7 矩阵的约化行阶梯形式 ·················································································.52 目录 VII 4.1.8 矩阵空间之间的夹角 ····················································································.52 4.2 线性方程组 ·········································································································.53 4.2.1 线性方程组问题 ··························································································.53 4.2.2 线性方程组的一般解 ····················································································.53 4.2.3 恰定方程组的求解 ·······················································································.54 4.2.4 超定线性方程组的求解 ·················································································.54 4.3 矩阵分解 ············································································································.55 4.3.1 对称正定矩阵的Cholesky 分解 ·······································································.55 4.3.2 一般方阵的高斯消元法 ·················································································.56 4.3.3 矩形矩阵的正交分解 ····················································································.57 4.4 矩阵的特征值和特征向量 ·······················································································.58 4.5 非线性矩阵运算 ···································································································.59 4.5.1 矩阵指数运算 ·····························································································.59 4.5.2 矩阵对数运算 ·····························································································.60 4.5.3 矩阵开平方运算 ··························································································.60 4.5.4 一般非线性矩阵运算 ····················································································.61 4.6 本章小结 ············································································································.61 第5 章 数学函数 ···········································································································.62 5.1 初等函数运算 ······································································································.63 5.1.1 三角函数 ···································································································.63 5.1.2 指数和对数函数 ··························································································.64 5.1.3 复数函数 ···································································································.65 5.1.4 截断和求余函数 ··························································································.66 5.2 特殊数学函数运算 ································································································.67 5.2.1 特殊函数 ···································································································.67 5.2.2 坐标变换函数 ·····························································································.71 5.2.3 数论函数 ···································································································.71 5.3 本章小结 ············································································································.72 第6 章 数据绘图 ···········································································································.73 6.1 二维图形的绘制 ···································································································.74 6.1.1 plot 二维绘图命令 ·······················································································.74 6.1.2 多次叠图和多子图操作 ·················································································.77 6.1.3 fplot 二维绘图命令 ······················································································.79 6.1.4 ezplot 二维绘图命令 ·····················································································.80 6.2 三维图形的绘制 ···································································································.81 6.2.1 plot3 ·········································································································.81 6.2.2 三维网格图和三维曲面图的绘制 ·····································································.82 MATLAB R2020a 入门、精通与实战 VIII 6.2.3 其他三维绘图命令 ·······················································································.83 6.3 特殊图形的绘制 ···································································································.85 6.3.1 二维特殊图形函数 ·······················································································.86 6.3.2 三维特殊图形函数 ·······················································································.92 6.3.3 特殊坐标轴函数 ··························································································.95 6.3.4 四维表现图(三维体切片平面) ·····································································.98 6.4 本章小结 ············································································································.99 第7 章 图形处理 ··········································································································.100 7.1 图形标识 ···········································································································.101 7.1.1 坐标轴与图形标注 ······················································································.101 7.1.2 图形的文本标注 ·························································································.102 7.1.3 图例的标注 ·······························································································.103 7.2 图形控制 ···········································································································.104 7.2.1 图形数据取点 ····························································································.104 7.2.2 坐标轴控制 ·······························································································.105 7.2.3 视角与透视控制 ·························································································.108 7.2.4 图形色彩控制 ····························································································.111 7.2.5 光照控制 ··································································································.115 7.3 图形窗口的操作 ··································································································.117 7.3.1 图形窗口的创建 ·························································································.118 7.3.2 图形窗口的菜单操作 ···················································································.118 7.3.3 图形窗口工具栏 ·························································································.122 7.3.4 图形的打印与输出 ······················································································.124 7.4 本章小结 ···········································································································.124 第8 章 程序设计 ··········································································································.125 8.1 M 文件 ··············································································································.126 8.1.1 函数 ········································································································.126 8.1.2 脚本 ········································································································.127 8.2 语法规则 ···········································································································.128 8.2.1 程序设计中的变量 ······················································································.128 8.2.2 编程方法 ··································································································.130 8.2.3 顺序语句 ··································································································.130 8.2.4 循环语句 ··································································································.130 8.2.5 条件语句 ··································································································.131 8.2.6 其他流程控制语句 ······················································································.133 8.3 程序调试 ···········································································································.134 8.3.1 直接调试法 ·······························································································.134 8.3.2 工具调试法 ·······························································································.135 目录 IX 8.3.3 程序调试命令 ····························································································.137 8.3.4 程序剖析 ··································································································.138 8.4 程序设计与实现 ··································································································.142 8.4.1 建立数学模型 ····························································································.142 8.4.2 代码编写 ··································································································.143 8.5 本章小结 ···········································································································.144 第9 章 数值计算 ··········································································································.145 9.1 线性方程组的解法 ·······························································································.146 9.1.1 解线性方程组的直接法 ················································································.146 9.1.2 解线性方程组的迭代法 ················································································.148 9.1.3 利用MATLAB 求解线性方程组 ·····································································.150 9.2 数值逼近方法 ·····································································································.153 9.2.1 插值 ········································································································.153 9.2.2 曲线拟合 ··································································································.158 9.2.3 数值积分 ··································································································.161 9.3 常微分方程(组)的数值求解 ················································································.163 9.3.1 常微分方程初值问题的离散化 ·······································································.164 9.3.2 常微分方程初值问题 ···················································································.165 9.4 数据分析和多项式 ·······························································································.170 9.4.1 基本数据分析函数 ······················································································.170 9.4.2 多项式函数 ·······························································································.173 9.5 本章小结 ···········································································································.175 第10 章 符号计算 ········································································································.176 10.1 符号运算入门 ···································································································.177 10.1.1 求方程的根 ·····························································································.177 10.1.2 求函数的导数 ··························································································.177 10.1.3 求解微分方程 ··························································································.178 10.2 符号对象的创建和使用 ·······················································································.178 10.2.1 创建符号对象和表达式 ··············································································.178 10.2.2 符号对象的基本运算 ·················································································.181 10.3 符号表达式的操作 ·····························································································.182 10.3.1 符号表达式的替换 ····················································································.182 10.3.2 精度计算 ································································································.183 10.3.3 符号表达式的化简 ····················································································.184 10.4 符号微积分及其变换 ··························································································.186 10.4.1 符号表达式的微分运算 ··············································································.186 10.4.2 符号表达式的级数与积分 ···········································································.188 10.4.3 符号积分变换 ··························································································.189 MATLAB R2020a 入门、精通与实战 X 10.5 符号矩阵的计算 ································································································.191 10.5.1 代数基本运算 ··························································································.191 10.5.2 线性代数运算 ··························································································.191 10.5.3 特征值分解 ·····························································································.192 10.5.4 约当标准型 ·····························································································.192 10.5.5 奇异值分解 ·····························································································.193 10.6 符号方程求解 ···································································································.193 10.6.1 代数方程的求解 ·······················································································.194 10.6.2 微分方程的求解 ·······················································································.195 10.7 可视化数学分析窗口 ··························································································.196 10.7.1 图示化符号函数计算器 ··············································································.196 10.7.2 Taylor 级数逼近分析器···············································································.197 10.8 本章小结 ·········································································································.198 第11 章 句柄图形 ········································································································.199 11.1 句柄图形体系 ···································································································.200 11.1.1 图形系统 ································································································.200 11.1.2 句柄图形的概念 ·······················································································.200 11.1.3 对象属性及其检测和变更 ···········································································.202 11.2 图形对象的操作 ································································································.205 11.2.1 创建图形对象 ··························································································.206 11.2.2 查找对象 ································································································.207 11.2.3 图形对象的位置 ·······················································································.208 11.2.4 文本对象的位置 ·······················································································.209 11.3 属性默认值和factory 属性及打印位置 ····································································.211 11.3.1 设置属性默认值 ·······················································································.211 11.3.2 factory 属性 ·····························································································.214 11.3.3 打印位置 ································································································.214 11.4 句柄的使用方法 ································································································.215 11.4.1 访问对象句柄 ··························································································.215 11.4.2 使用句柄操作图形对象 ··············································································.216 11.4.3 删除对象 ································································································.217 11.4.4 控制图形输出 ··························································································.217 11.4.5 在M 文件中保存句柄 ················································································.219 11.5 句柄图形的应用举例 ··························································································.220 11.6 本章小结 ·········································································································.222 第12 章 输入与输出 ·····································································································.223 12.1 文件的打开与关闭 ·····························································································.224 12.1.1 打开文件 ································································································.224 目录 XI 12.1.2 关闭文件 ································································································.225 12.2 文件的读取与写入 ·····························································································.225 12.2.1 读取二进制文件 ·······················································································.225 12.2.2 写入二进制文件 ·······················································································.227 12.2.3 写入文本文件 ··························································································.228 12.2.4 读取文本文件 ··························································································.230 12.2.5 文件格式化和二进制输入/输出比较 ······························································.231 12.3 文件位置控制和状态函数 ····················································································.233 12.3.1 exist 函数 ································································································.234 12.3.2 ferror 函数 ·······························································································.235 12.3.3 feof 函数 ·································································································.235 12.3.4 ftell 函数 ·································································································.235 12.3.5 frewind 函数 ····························································································.235 12.3.6 fseek 函数 ·······························································································.235 12.4 本章小结 ·········································································································.237 第13 章 Simulink 仿真 ·································································································.238 13.1 Simulink 概论 ····································································································.239 13.1.1 Simulink 简介···························································································.239 13.1.2 启动Simulink ··························································································.239 13.1.3 Simulink 模型的特点··················································································.241 13.1.4 Simulink 实例···························································································.243 13.2 Simulink 模型创建 ······························································································.245 13.2.1 模块操作 ································································································.245 13.2.2 信号线操作 ·····························································································.246 13.2.3 模型的注释 ·····························································································.248 13.2.4 系统建模和系统仿真的基本步骤 ··································································.249 13.2.5 信源Source ·····························································································.253 13.2.6 信宿Sink ································································································.259 13.2.7 过零检测 ································································································.264 13.2.8 仿真配置 ································································································.266 13.2.9 启动仿真 ································································································.270 13.3 子系统的创建与封装 ··························································································.271 13.3.1 子系统介绍 ·····························································································.271 13.3.2 创建子系统 ·····························································································.272 13.3.3 封装子系统 ·····························································································.273 13.4 仿真模型的分析 ································································································.276 13.4.1 确定模型的状态 ·······················································································.276 13.4.2 平衡点的分析 ··························································································.277 MATLAB R2020a 入门、精通与实战 XII 13.4.3 微分方程的求解 ·······················································································.278 13.4.4 代数环 ···································································································.279 13.5 仿真的运行 ······································································································.280 13.5.1 启动仿真 ································································································.280 13.5.2 仿真的配置 ·····························································································.281 13.5.3 观测仿真结果 ··························································································.285 13.5.4 仿真调试 ································································································.286 13.6 S 函数 ·············································································································.287 13.6.1 S 函数的工作原理 ·····················································································.287 13.6.2 编写S 函数 ·····························································································.287 13.7 Simulink 与MATLAB 结合建模实例 ·······································································.291 13.8 本章小结 ·········································································································.294 附录A Simulink 模块库 ·······························································································.295 参考文献 ·······················································································································.304
你还可能感兴趣
我要评论
|