MATLAB課程設(shè)計(jì)_第1頁(yè)
MATLAB課程設(shè)計(jì)_第2頁(yè)
MATLAB課程設(shè)計(jì)_第3頁(yè)
MATLAB課程設(shè)計(jì)_第4頁(yè)
MATLAB課程設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩21頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、MATLAB程序設(shè)計(jì)基礎(chǔ)程序設(shè)計(jì)基礎(chǔ)山東大學(xué)控制科學(xué)與工程學(xué)院李曉磊MATLAB的發(fā)展歷程 o MATLAB MATrix LABoratory o 20世紀(jì)七十年代后期:時(shí)任美國(guó)新墨西哥大學(xué)計(jì)算機(jī)科學(xué)系主任的Cleve Moler教授用FORTRAN設(shè)計(jì)了一組程序接口,此即萌芽狀態(tài)的MATLAB。 o 1984年成立了MathWorks公司,并把MATLAB正式推向市場(chǎng)。從這時(shí)起,MATLAB的內(nèi)核采用C語(yǔ)言編寫,而且除原有的數(shù)值計(jì)算能力外,還新增了數(shù)據(jù)圖視功能。 o 進(jìn)入20世紀(jì)九十年代的時(shí)候,MATLAB已經(jīng)成為國(guó)際控制界公認(rèn)的標(biāo)準(zhǔn)計(jì)算軟件。 主要版本o1993年推出MATLAB4.0版

2、本 (1)推出了SIMULINK。這是一個(gè)交互式操作的動(dòng)態(tài)系統(tǒng)建模、仿真、分析集成環(huán)境。(2)開發(fā)了與外部進(jìn)行直接數(shù)據(jù)交換的組件,打通了MATLAB進(jìn)行實(shí)時(shí)數(shù)據(jù)分析、處理和硬件開發(fā)的道路。(3)推出了符號(hào)計(jì)算工具包。(4)Notebook 實(shí)現(xiàn)了MATLAB與Word的無縫連接。其升級(jí)版本MATLAB4.2c應(yīng)用較廣泛。 o1997年,MATLAB5.0版問世,緊接著是5.1、5.2,以及和1999年春的5.3版,真正32位運(yùn)算,功能強(qiáng)大,數(shù)值計(jì)算加快,擁有更豐富的數(shù)據(jù)類型和結(jié)構(gòu)、更友善的面向?qū)ο蟆⒏涌焖倬嫉膱D形可視、更廣博的數(shù)學(xué)和數(shù)據(jù)分析資源、更多的應(yīng)用開發(fā)工具。其中MATLAB5.3應(yīng)

3、用最廣泛。o2001年推出了MATLAB6.0,直到現(xiàn)在廣泛使用的MATLAB 6.5,其界面有較大的改觀,計(jì)算速度有了比較大的改善,增加了與Java的接口 。MATLAB應(yīng)用與網(wǎng)上資源o 工具箱 信號(hào)處理、神經(jīng)網(wǎng)絡(luò)、魯棒控制、系統(tǒng)辨識(shí)、控制系統(tǒng)、圖形處理、模糊邏輯、小波分析、金融管理、概率統(tǒng)計(jì)、非線性控制等。o 網(wǎng)絡(luò)資源 MATLAB安裝o 硬件要求 x86:o 軟件要求 Windows: Linux: Adobe acrobat readerMATLAB程序執(zhí)行方式o 立即執(zhí)行 3.5*6.2ans = 21.7000 exp(j*3*pi/4)ans = -0.7071 + 0.7071

4、i o M文件:純文本文件,擴(kuò)展名為M,用任何字處理軟件都可以編輯修改。?type exa1.m%This is an example.exp(j*3*pi/4)?exa1ans = -0.7071 + 0.7071iMATLAB命令窗口o 計(jì)算機(jī)安裝好MATLAB之后,雙擊MATLAB圖標(biāo),就可以進(jìn)入命令窗口,此時(shí)意味著系統(tǒng)處于準(zhǔn)備接受命令的狀態(tài),可以在命令窗口中直接輸入命令語(yǔ)句。o 通用命令 cd 顯示或改變工作目錄 hold 圖形保持開關(guān) dir 顯示目錄下的文件disp 顯示變量或文字內(nèi)容 type 顯示文件內(nèi)容path 顯示搜索目錄 clear 清理內(nèi)存變量save 保存內(nèi)存變量到指

5、定文件 clf 清除圖形窗口load 加載指定文件的變量 pack 收集內(nèi)存碎片diary 日志文件 clc 清除工作窗quit 退出MATLAB echo 工作窗信息顯示開關(guān)! 調(diào)用dos命令o 命令行鍵盤技巧 調(diào)用上一行home 光標(biāo)置于當(dāng)前行開頭 調(diào)用下一行end 光標(biāo)置于當(dāng)前行末尾 光標(biāo)左移一個(gè)字符esc 清除當(dāng)前輸入行 光標(biāo)右移一個(gè)字符del 刪除光標(biāo)處的字符 Ctrl 光標(biāo)左移一個(gè)單詞backspace 刪除光標(biāo)前的字符 Ctrl 光標(biāo)右移一個(gè)單詞altbackspace 恢復(fù)上一次的刪除o 標(biāo)點(diǎn) : 具有多種應(yīng)用功能. 小數(shù)點(diǎn)及域訪問符 ;區(qū)分行,取消運(yùn)行顯示等 續(xù)行符 ,區(qū)分列

6、,函數(shù)參數(shù)分隔符% 注釋標(biāo)記 () 指定運(yùn)算先后次序! 調(diào)用操作系統(tǒng)運(yùn)算 矩陣定義標(biāo)志 賦值標(biāo)記 用于構(gòu)成單元數(shù)組 字符串標(biāo)示符MATLAB搜索路徑o MATLAB的一切操作都是在其搜索路徑中進(jìn)行的,如果調(diào)用的函數(shù)在搜索路徑之外,系統(tǒng)將認(rèn)為該函數(shù)不存在。o 路徑設(shè)置方法l 1、通過對(duì)話框設(shè)置 在MATLAB主窗口菜單中【file】【set Path】選項(xiàng)。l 2、path命令?pathMATLABPATHE:MATLABworksE:MATLABtoolboxmatlabgeneralE:MATLABtoolboxmatlabopsE:MATLABtoolboxmatlablangE:MATL

7、ABtoolboxmatlabelmatE:MATLABtoolboxmatlabelfunE:MATLABtoolboxmatlabspecfunE:MATLABtoolboxmatlabmatfunE:MATLABtoolboxmatlabdatafunE:MATLABtoolboxmatlabpolyfun 2.1 path命令?genpathans =E:MATLABtoolboxmatlabdatafun;E:MATLABtoolboxmatlabdatatypes;E:MATLABtoolboxmatlabdemos;E:MATLABtoolboxmatlabelfun;E:MAT

8、LABtoolboxmatlabelmat;E:MATLABtoolboxmatlabfunfun;E:MATLABtoolboxmatlabgeneral;E:MATLABtoolboxmatlabgraph2d;E:MATLABtoolboxmatlabgraph3d;E:MATLABtoolboxmatlabgraphics;E:MATLABtoolboxmatlabiofun;E:MATLABtoolboxmatlabiofunsrc;E:MATLABtoolboxmatlablang;E:MATLABtoolboxmatlabmatfun;2.2 genpath命令2.3 editp

9、ath或pathtool命令2.4 擴(kuò)展搜索路徑 將新目錄擴(kuò)展到搜索路徑中 1、用path命令 ?path(path,e:matlabworks) 2、用addpath命令 將新目錄加到搜索路徑的末尾 ?addpath e:matlabworks end 將新目錄加到搜索路徑的開始 ?addpath e:matlabworks -begin 3、使用路徑設(shè)置對(duì)話框MATLAB幫助o MATLAB Help 完善的HTML格式聯(lián)機(jī)幫助系統(tǒng),非常全面。使用方法: 1.從help菜單中選取; 2.在命令窗口中執(zhí)行helpdesk或doc。o PDF文檔 用Adobe acrobat reader閱讀

10、。Help系列o helpwino Help?helpHELP topics:matlabgeneral - General purpose commands.matlabops - Operators and special characters.matlablang - Programming language constructs.matlabelmat - Elementary matrices and matrix manipulation.matlabelfun - Elementary math functions.matlabspecfun - Specialized math

11、 functions.matlabmatfun - Matrix functions - numerical linear algebra.matlabdatafun - Data analysis and Fourier transforms. For more help on directory/topic, type help topic.o Help + 函數(shù)(類)名?help general General purpose commands. MATLAB Toolbox Version 5.2 18-Dec-1997 General information help - On-li

12、ne 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,

13、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 s

14、tring 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) d

15、isplays 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 s

16、tring 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

17、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(Hel

18、p 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.o Lookfor 根據(jù)用戶提供的關(guān)鍵字搜索相關(guān)的函數(shù)。?lookfor diffSETDIFF 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 diffe

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論