MATLAB第一章作業(yè)答案_第1頁
MATLAB第一章作業(yè)答案_第2頁
MATLAB第一章作業(yè)答案_第3頁
MATLAB第一章作業(yè)答案_第4頁
全文預(yù)覽已結(jié)束

下載本文檔

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

文檔簡介

1、第一章 MATLAB概況與基本操作1 .選擇題:(1)最初的MATLA眼心程序是采用A語言編寫的。即將于2011年9月發(fā)布的MATLA畸版本的編號為D 。2011Ra2011Rb R2011a R2011b(3)在默認設(shè)置中,MATLA沖的注釋語句顯示的顏色是D 。A.黑色 B. 藍色 C. 紅色 D. 綠色(4)如果要以科學(xué)計數(shù)法顯示15位有效數(shù)字,使用的命令是B olong long e long g long d(5)在命令窗口新建變量a、b,如果只查看變量 a的詳細信息,使用的命令為B 。a a(6)如果要清除工作空間的所有變量,使用的命令為C oall C.兩者都可D. 兩者都不可(

2、7)在創(chuàng)建變量時,如果不想立即在命令窗口中輸出結(jié)果,可以在命令后加上D qA.冒號 B. 逗號 C.空格 D.分號(8)如果要重新執(zhí)行以前輸入的命令,可以使用B 鍵。A.下箭頭JB.上箭頭TC.左箭頭一D.右箭頭-(9)如果要查詢函數(shù)inv的相關(guān)信息,并顯示在命令窗口,應(yīng)使用命令A(yù)。D. 三者均可(10)如果要啟動Notebook文檔,下列 D操作是可行的。A.在命令窗口輸入 notebook命令B.在命令窗口輸入 notebook filename 命令C.在 Word中啟動 M-book文檔D.三者均可2 .填空題:(1)MATLAB是MATrix和LABoratory 兩個單詞前三個字母

3、的組合,意為“矩陣實驗室”,它的創(chuàng)始人是 Cleve Moler 和 Jack Little 。在MATLAB勺默認而電一而字顯示的字體為藍魚,命令、表達式、計算結(jié)果顯示的字體 為黑色,字符串顯示的字體為遂魚,注釋顯示的字體為 綠魚,錯誤信息顯示的字體為 紅色。(3)在命令窗口中,輸出結(jié)果顯示為各行之間添加空行的命令為format compact ,各行之間不添加空行的命令為 format compact 。備注:本題布置給大家時有一點小錯誤,現(xiàn)在予以更正。在MATLA葉,各種標點符號的作用是不同的。例如,空格的作用是分隔數(shù)組中每一行的各個元塞,逗號的作用是分隔數(shù)組中每一行的各個元素或不同的命

4、令,分號的作用是分隔數(shù)組中的各行或控制命令執(zhí)行結(jié)果是否在命令窗口顯示,冒號的作用是生成一維數(shù)組或顯示全部元素,百分號的作用是注釋行的開頭,的作用是把相鄰兩行的語句連接為一個命令,感嘆號的作用是執(zhí)行操作系統(tǒng)命令。371建立自己的工作目錄,再將自己的工作目錄設(shè)置到MATLA眼索路徑下。請寫出操作步驟或用Matlab命令實現(xiàn)。用 help命令能查詢到自己的工作目錄嗎 解:操作步驟:(1)在 Windows環(huán)境中建立一個工作目錄,如: c:mywork ;啟動MATLAB在File菜單中選擇 Set Path命令,顯示出如下圖的對話框:ATLAfi T.4-U E2UQT心Fi.lt Edit Det

5、uf Desktop 也i 工 d*制 HtlfD *tcaUI tAi ;aLder to fat上Tuw t &11 Shi *1 e Tni t 鳥 11 i 口一It t ExplmrMwlt 9.i M,H3川Q心口 07自f< I f 7新建立怦莢也)j 即片 選擇Add Folder按鈕,又顯示出如下圖的對話框:(4)在該對話框中找到 c:mywork文件夾,選擇確定按鈕。 返回步驟(2)的對話框,選擇 Save按鈕,然后選擇 Close按鈕,關(guān)閉對話框。(注意:選擇Save和Close按鈕的次序不能錯,如果先選擇Close按鈕,就會直接關(guān)閉對話框,而不會將你的工作

6、目錄添加到搜索路徑中。采用這種方法設(shè)置的工作路徑是永久性的,只要不在步驟(2)的對話框中選擇 Remove按鈕移除該文件夾,那么你在該文件夾中保存的文件MATLAB總能找到。4.利用MATLAB勺幫助功能分別查詢inv、plot、max、round等函數(shù)的功能及用法。解:所使用的命令分別為help invINV Matrix inverse.INV(X) is the inverse of the square matrix X.A warning message is printed if X is badly scaled or nearly singular.See also SLASH

7、, PINV, COND, CONDEST, LSQNONNEG, LSCOV.Overloaded functions or methods (ones with the same name in other directories) help gf/ help lti/ help idmodel/ help atom/ help ndlft/ help ufrd/ help umat/ help uss/ help sym/Reference page in Help browser doc invhelp plotPLOT Linear plot.PLOT(X,Y) plots vect

8、or Y versus vector X. If X or Y is a matrix, then the vector is plotted versus the rows or columns of the matrix, whichever line up. If X is a scalar and Y is a vector, disconnected line objects are created and plotted as discrete points vertically at X.PLOT(Y) plots the columns of Y versus their in

9、dex.If Y is complex, PLOT(Y) is equivalent to PLOT(real(Y),imag(Y).In all other uses of PLOT, the imaginary part is ignored.Various line types, plot symbols and colors may be obtained with PLOT(X,Y,S) where S is a character string made from one element from any or all the following 3 columns:bblue.

10、point- solidggreeno circle: dottedrredx x-mark-. dashdotccyan+ plus- dashedmmagenta* star(none) no lineyyellows squarekblackd diamondwwhitev triangle (down)人triangle (up)<triangle (left)>triangle (right)ppentagramhhexagramFor example, PLOT(X,Y,'c+:') plots a cyan dotted line with a plu

11、s at each data point; PLOT(X,Y,'bd') plots blue diamond at each data point but does not draw any line.PLOT(X1,Y1,S1,X2,Y2,S2,X3,Y3,S3,.) combines the plots defined by the (X,Y,S) triples, where the X's and Y's are vectors or matrices and the S's are strings.For example, PLOT(X,Y,

12、'y-',X,Y,'go') plots the data twice, with a solid yellow line interpolating green circles at the data points.The PLOT command, if no color is specified, makes automatic use of the colors specified by the axes ColorOrder property. The default ColorOrder is listed in the table above fo

13、r color systems where the default is blue for one line, and for multiple lines, to cycle through the first six colors in the table. For monochrome systems, PLOT cycles over the axes LineStyleOrder property.If you do not specify a marker type, PLOT uses no marker.If you do not specify a line style, P

14、LOT uses a solid line.PLOT(AX,.) plots into the axes with handle AX.PLOT returns a column vector of handles to lineseries objects, one handle per plotted line.The X,Y pairs, or X,Y,S triples, can be followed by parameter/value pairs to specify additional properties of the lines. For example, PLOT(X,

15、Y,'LineWidth',2,'Color',.6 0 0) will create a plot with a dark red line width of 2 points.Examplex = -pi:pi/10:pi;y = tan(sin(x) - sin(tan(x);plot(x,y,'-rs','LineWidth',2,.'MarkerEdgeColor','k',. 'MarkerFaceColor','g',. 'MarkerSize&

16、#39;,10)See also PLOTTOOLS, SEMILOGX, SEMILOGY, LOGLOG, PLOTYY, PLOT3, GRID, TITLE, XLABEL, YLABEL, AXIS, AXES, HOLD, LEGEND, SUBPLOT, SCATTER, PLOT3.Overloaded functions or methods (ones with the same name in other directories) help SimTimeseries/ help timeseries/ help phytree/ help channel/ help cfit/ help darray/ help fints/ help iddata/help idfrd/ help idmodel/ help idnlarx/ help idnlhw/ help cgrules/ help localavfit/ help localmod/ help localmulti/ help xregarx/ help xregmodel/ help xregtransient/ help xregtwostage/ help mdevtestplan/ help sweepset/ he

溫馨提示

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

評論

0/150

提交評論