收藏 分销(赏)

MATLAB编程基础第一讲.ppt

上传人:仙人****88 文档编号:14752576 上传时间:2026-11-13 格式:PPT 页数:26 大小:427.50KB 下载积分:10 金币
下载 相关
MATLAB编程基础第一讲.ppt_第1页
第1页 / 共26页
MATLAB编程基础第一讲.ppt_第2页
第2页 / 共26页


点击查看更多>>
资源描述
单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,*,MATLAB,编程基础,中国海洋大学 工程学院,梁丙臣,MATLAB,的发展历程,MATLAB,MATrix,LABoratory,20,世纪七十年代后期:时任美国新墨西哥大学计算机科学系主任的,Cleve,Moler,教授用,FORTRAN,设计了一组程序接口,此即萌芽状态的,MATLAB,。,1984,年成立了,MathWorks,公司,并把,MATLAB,正式推向市场。从这时起,,MATLAB,的内核采用,C,语言编写,而且除原有的数值计算能力外,还新增了数据图视功能。,进入,20,世纪九十年代的时候,,MATLAB,已经成为国际控制界公认的标准计算软件。,主要版本,1993,年推出,MATLAB4.0,版本(,1,)推出了,SIMULINK,。这是一个交互式操作的动态系统建模、仿真、分析集成环境。(,2,)开发了与外部进行直接数据交换的组件,打通了,MATLAB,进行实时数据分析、处理和硬件开发的道路。(,3,)推出了符号计算工具包。(,4,),Notebook,实现了,MATLAB,与,Word,的无缝连接。其升级版本,MATLAB4.2c,应用较广泛。,1997,年,,MATLAB5.0,版问世,紧接着是,5.1,、,5.2,,以及和,1999,年春的,5.3,版,真正,32,位运算,功能强大,数值计算加快,拥有更丰富的数据类型和结构、更友善的面向对象、更加快速精良的图形可视、更广博的数学和数据分析资源、更多的应用开发工具。其中,MATLAB5.3,应用最广泛。,2001,年推出了,MATLAB6.0,,直到现在广泛使用的,MATLAB 6.5,,其界面有较大的改观,计算速度有了比较大的改善,增加了与,Java,的接口。,MATLAB,应用与网上资源,工具箱,信号处理、神经网络、鲁棒控制、系统辨识、控制系统、图形处理、模糊逻辑、小波分析、金融管理、概率统计、非线性控制等。,网络资源,MATLAB,安装,硬件要求,x86:,软件要求,Windows:,Linux:,Adobe acrobat reader,MATLAB,程序执行方式,立即执行,3.5*6.2,ans,=,21.7000,exp(j,*3*pi/4),ans,=,-0.7071+0.7071i,M,文件:纯文本文件,扩展名为,M,,用任何字处理软件都可以编辑修改。,?type exa1.m,%This is an example.,exp(j,*3*pi/4),?exa1,ans,=,-0.7071+0.7071i,MATLAB,命令窗口,计算机安装好,MATLAB,之后,双击,MATLAB,图标,就可以进入命令窗口,此时意味着系统处于准备接受命令的状态,可以在命令窗口中直接输入命令语句。,通用命令,cd,显示或改变工作目录,hold,图形保持开关,dir,显示目录下的文件,disp,显示变量或文字内容,type,显示文件内容,path,显示搜索目录,clear,清理内存变量,save,保存内存变量到指定文件,clf,清除图形窗口,load,加载指定文件的变量,pack,收集内存碎片,diary,日志文件,clc,清除工作窗,quit,退出,MATLAB,echo,工作窗信息显示开关!调用,dos,命令,命令行键盘技巧,调用上一行,home,光标置于当前行开头,调用下一行,end,光标置于当前行末尾,光标左移一个字符,esc,清除当前输入行,光标右移一个字符,del,删除光标处的字符,Ctrl,光标左移一个单词,backspace,删除光标前的字符,Ctrl,光标右移一个单词,alt,backspace,恢复上一次的删除,标点,:具有多种应用功能,.,小数点及域访问符,;区分行,取消运行显示等,续行符,,区分列,函数参数分隔符,%,注释标记,(),指定运算先后次序,!,调用操作系统运算,矩阵定义标志 赋值标记,用于构成单元数组,字符串标示符,MATLAB,搜索路径,MATLAB,的一切操作都是在其搜索路径中进行的,如果调用的函数在搜索路径之外,系统将认为该函数不存在。,路径设置方法,1,、通过对话框设置,在,MATLAB,主窗口菜单中,【file】,【set Path】,选项。,2,、,path,命令,?path,MATLABPATH,E:MATLABworks,E:MATLABtoolbox,matlab,general,E:MATLABtoolbox,matlab,ops,E:MATLABtoolbox,matlablang,E:MATLABtoolbox,matlabelmat,E:MATLABtoolbox,matlabelfun,E:MATLABtoolbox,matlabspecfun,E:MATLABtoolbox,matlabmatfun,E:MATLABtoolbox,matlabdatafun,E:MATLABtoolbox,matlabpolyfun,2.1 path,命令,?,genpath,ans,=,E:MATLABtoolboxmatlabdatafun;E:MATLABtoolboxmatlabdatatypes;E:MATLABtoolboxmatlabdemos;E:MATLABtoolboxmatlabelfun;E:MATLABtoolboxmatlabelmat;E:MATLABtoolboxmatlabfunfun;E:MATLABtoolboxmatlabgeneral;E:MATLABtoolboxmatlabgraph2d;E:MATLABtoolboxmatlabgraph3d;E:MATLABtoolboxmatlabgraphics;E:MATLABtoolboxmatlabiofun;E:MATLABtoolboxmatlabiofunsrc;E:MATLABtoolboxmatlablang;E:MATLABtoolboxmatlabmatfun;,2.2,genpath,命令,2.3,editpath,或,pathtool,命令,2.4,扩展搜索路径,将新目录扩展到搜索路径中,1,、用,path,命令,?,path(path,e:matlabworks,),2,、用,addpath,命令,将新目录加到搜索路径的末尾,?,addpath,e:matlabworks,end,将新目录加到搜索路径的开始,?,addpath,e:matlabworks,-begin,3,、使用路径设置对话框,MATLAB,帮助,MATLAB Help,完善的,HTML,格式联机帮助系统,非常全面。使用方法:,1.,从,help,菜单中选取;,2.,在命令窗口中执行,helpdesk,或,doc,。,PDF,文档,用,Adobe acrobat reader,阅读。,Help,系列,helpwin,Help,?help,HELP topics:,matlab,general -General purpose commands.,matlab,ops -Operators and special characters.,matlablang,-Programming language constructs.,matlabelmat,-Elementary matrices and matrix manipulation.,matlabelfun,-Elementary math functions.,matlabspecfun,-Specialized math functions.,matlabmatfun,-Matrix functions-numerical linear algebra.,matlabdatafun,-Data analysis and Fourier transforms.,For more help on directory/topic,type help topic.,Help+,函数(类)名,?help general,General purpose commands.,MATLAB Toolbox Version 5.2 18-Dec-1997,General information,help -On-line help,display text at command line.,helpwin,-On-line help,separate window for navigation.,helpdesk -Comprehensive hypertext documentation and troubleshooting.,demo -Run demonstrations.,ver,-MATLAB,SIMULINK,and toolbox version information.,See also PUNCT.,?help,helpwin,HELPWIN On-line help,separate window for navigation.,HELPWIN TOPIC opens a help window and displays the help text for the,given TOPIC.Links are created to functions referenced in the See Also,line of the help text.,HELPWIN(HELP_STR,TITLE)displays the string HELP_STR in the help,window.HELP_STR may be passed in as a string with each line separated,by carriage returns,a column vector cell array of strings with each cell,(row)representing a line or as a string matrix with each row representing,a line.The optional string TITLE will appear in the title edit box.,HELPWIN(TITLE1 HELP_STR1;TITLE2 HELP_STR2;.,PAGE)displays one page,of multi-page help text.The multi-page help text is passed in as a,cell array of strings or cells containing TITLE and HELP_STR pairs.,Each row of the multi-page help text cell array(dimensioned number of,pages by 2)consists of a title string paired with a string,cell array,or string matrix of help text.The second argument PAGE is a string,which must match one of the TITLE entries in the multi-page help text.,The matching TITLE represents the page that is to be displayed first.,If no second argument is given,the first page is displayed.,A third argument may be passed to HELPWIN which is a string that becomes,the title of the help window figure.,Additional arguments,after the window title,will be interpreted as,Handle Graphics parameter-value pairs to be applied to the text displayed,in the help window.,Examples.,helpwin,plot,helpwin(Help,String,title,),helpwin(Help,text for,sprintf(n,)my,m-file.,title,),helpwin(Help,String,for;my,m-file,title,),helpwin(str,Topic,2,My Title),where,str,=Topic 1 Help string for Topic 1;,Topic 2 Help string for Topic 2;,Topic 3 Help string for Topic 3,See also DOC,DOCOPT,HELP,WEB.,Lookfor,根据用户提供的关键字搜索相关的函数。,?,lookfor,diff,SETDIFF Set difference.,DIFF Difference and approximate derivative.,POLYDER Differentiate polynomial.,ODE113 Solve non-stiff differential equations,variable order method.,ODE15S Solve stiff differential equations,variable order method.,ODE23 Solve non-stiff differential equations,low order method.,ODE23S Solve stiff differential equations,low order method.,帮助机理,Help,命令显示相应,M,文件的注释区,Lookfor,命令搜索路径中每个,M,文件的第一行,扫描是否包含所要查询的字符串。,?help exa1,This is an example.,其他帮助命令,Exist,变量检验函数,What,目录中文件列表,Who,内存变量列表,Whos,内存变量详细信息,Which,确定,文件位置,联机演示系统,基本介绍,Intro,演示,demo,
展开阅读全文

开通  VIP、SVIP  下载更划算
下载10份以上建议开通 VIP 会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        关注我们

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服