數(shù)學(xué)軟件實(shí)驗(yàn)報告)_第1頁
數(shù)學(xué)軟件實(shí)驗(yàn)報告)_第2頁
數(shù)學(xué)軟件實(shí)驗(yàn)報告)_第3頁
數(shù)學(xué)軟件實(shí)驗(yàn)報告)_第4頁
數(shù)學(xué)軟件實(shí)驗(yàn)報告)_第5頁
已閱讀5頁,還剩18頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、大學(xué)實(shí)驗(yàn)報告學(xué)院名稱:理學(xué)院 專業(yè)年級:2013級信計1班姓 名 學(xué) 號:課 程:數(shù)學(xué)軟件實(shí)驗(yàn) 報告日期:2014年10月18日實(shí)驗(yàn)一 MATLAB的基本操作、基本指令及其用法一實(shí)驗(yàn)?zāi)康氖煜ATLAB軟件的發(fā)展歷程,學(xué)會MATLAB基本菜單使用,MATLAB的環(huán)境設(shè)置及其他常用選項(xiàng)設(shè)置方法,MATLAB幫助系統(tǒng)和演示系統(tǒng)的使用,MATLAB常用指令的使用方法,以及標(biāo)點(diǎn)符號的用法等。二實(shí)驗(yàn)要求了解數(shù)學(xué)軟件的發(fā)展,會使用MATLAB基本菜單,掌握常用設(shè)置方法,會使用MATLAB幫助和演示。三實(shí)驗(yàn)內(nèi)容此處正文(參閱數(shù)學(xué)實(shí)驗(yàn)實(shí)驗(yàn)一的第一節(jié)內(nèi)容和第二節(jié)部分內(nèi)容,將自己實(shí)驗(yàn)實(shí)習(xí)過程中的主要過程步驟寫在此

2、處)第一節(jié) MATLAB基本操作MATLAB是美國MathWorks公司出品的商業(yè)數(shù)學(xué)軟件,用于算法開發(fā)、數(shù)據(jù)可視化、數(shù)據(jù)分析以及數(shù)值計算的高級技術(shù)計算語言和交互式環(huán)境,主要包括MATLAB和Simulink兩大部分。MATLAB應(yīng)用非常之廣泛!第二節(jié) 基本數(shù)學(xué)運(yùn)算一.基本知識1.簡單矩陣的建立與矩陣元素(1)直接輸入矩陣>> a=1 2 3;3 4 5; 5 6 7(2)通過語句或者函數(shù)產(chǎn)生矩陣>> b=sin(a)>> c=a+0.3*(1+b/2) >> d=ones(3)+eye(3)(3).利用文本文件創(chuàng)建矩陣>> load

3、 ding.txt>> ding(4)從外部數(shù)據(jù)文件中裝入已有矩陣>>x=-5.26 sqrt(7) (2+6+96)*8/4>> x(5)=abs(1)>> e=a be = 1.0000 2.0000 3.0000 0.8415 0.9093 0.1411 3.0000 4.0000 5.0000 0.1411 -0.7568 -0.9589 5.0000 6.0000 7.0000 -0.9589 -0.2794 0.6570>> e=a be = 1.0000 2.0000 3.0000 3.0000 4.0000 5.000

4、0 5.0000 6.0000 7.0000 0.8415 0.9093 0.1411 0.1411 -0.7568 -0.9589 -0.9589 -0.2794 0.6570>> e=1 2 3 4 5 6;3 5 7 9 8 8;7 8 5 4 2 1 ;7 4 5 2 1 8g = 1 2 3 4 5 6 3 5 7 9 8 8 7 8 5 4 2 1 7 4 5 2 1 8>> f=g(;,2;5)f = 2 4 5 9 8 4 4 22.常量、變量與表達(dá)式(2)>> t='How about this character string?&

5、#39;t =How about this character string?(2)>> 'i can''t find my key'ans =i can't find my key(3)>> A='hello'A =hello>> B=2*AB = 208 202 216 216 222(4)>> c=1+2ic = 1.0000 + 2.0000i>> c=1+2*ic = 1.0000 + 2.0000i>> c=1+2*jc = 1.0000 + 2.0000

6、i>> c=1+2*sqrt(-1)c = 1.0000 + 2.0000i3.命令窗口常用的命令與標(biāo)點(diǎn)符號的使用>> help cd CD Change current working directory. CD directory-spec sets the current directory to the one specified. CD . moves to the directory above the current one. CD, by itself, prints out the current directory. WD = CD returns

7、the current directory as a string. Use the functional form of CD, such as CD('directory-spec'), when the directory specification is stored in a string. See also pwd. Overloaded methods: Reference page in Help browser doc cd4.內(nèi)存變量的編輯、保存和清除二.算術(shù)運(yùn)算1.加減法運(yùn)算>> a=1 1;2 2; b=ones(2); c=a+bc = 2

8、 2 3 3>> d=1 1 1;e=a+be = 2 2 3 3>> c1=c-2c1 = 0 0 1 12.乘除法運(yùn)算(1)>> f=a*bf = 2 2 4 4>> g=b*ag = 3 3 3 3>> h=pi*ah = 3.1416 3.1416 6.2832 6.2832>> A=a*cA = 5 5 10 10>> B=c*aB = 6 6 9 9>> A=a.*cA = 2 2 6 6>> B=c.*aB = 2 2 6 6(2)求解方程組解>> a=1 2

9、3;4 2 6;7 4 9 ;b=4;1;2;abans = -1.5000 2.0000 0.5000(3) >> a=rand(3),b=rand(3)a = 0.8147 0.9134 0.2785 0.9058 0.6324 0.5469 0.1270 0.0975 0.9575b = 0.9649 0.9572 0.1419 0.1576 0.4854 0.4218 0.9706 0.8003 0.9157>> a1=a/ba1 = 0.7571 0.3356 0.0323 0.2462 -0.4341 0.7590 -0.9446 0.4093 1.0035

10、>> a2=aba2 = -2.5775 -1.3591 -0.0618 3.0365 2.0130 -0.0863 1.0462 0.8110 0.9734>> a3=b/aa3 = 0.8306 0.3601 -0.2991 1.0730 -0.8795 0.6307 0.3442 0.6978 0.4577>> a4=baa4 =-1.8233 -1.1435 -0.2172 2.7367 2.1961 0.3685 -0.3205 -0.6006 0.9537 -1.8233 -1.1435 -0.2172 2.7367 2.1961 0.3685

11、-0.3205 -0.6006 0.9537(4)>> a5=(a'b')'a5 = 0.8306 0.3601 -0.2991 1.0730 -0.8795 0.6307 0.3442 0.6978 0.4577>> a6=b/aa6 = 0.8306 0.3601 -0.2991 1.0730 -0.8795 0.6307 0.3442 0.6978 0.4577> a7=a./ba7 = 0.8444 0.9542 1.9628 5.7469 1.3028 1.2967 0.1308 0.1219 1.0456(5)>>

12、a8=a.ba8 = 1.1843 1.0479 0.5095 0.1740 0.7676 0.7712 7.6433 8.2046 0.9564>> a8=1./a7a8 = 1.1843 1.0479 0.5095 0.1740 0.7676 0.7712 7.6433 8.2046 0.95643.乘冪運(yùn)算>> g=1 2 3 4;5 6 7 8;9 10 11 12;g.2ans = 1 4 9 16 25 36 49 64 81 100 121 144>> h=1 1 1 1 ;2 2 2 2 ;3 3 3 3 ;g.(h-1)ans = 1 1

13、1 1 5 6 7 8 81 100 121 144>> 2.gans = 2 4 8 16 32 64 128 256 512 1024 2048 40964.轉(zhuǎn)置運(yùn)算>> x=1 2 5;3 5 3;6 2 8x = 1 2 5 3 5 3 6 2 8>> y=x'y = 1 3 6 2 5 2 5 3 8>> a=1+2i 2-5i; 2+2i 8-2ia = 1.0000 + 2.0000i 2.0000 - 5.0000i 2.0000 + 2.0000i 8.0000 - 2.0000i>> b=a'b =

14、 1.0000 - 2.0000i 2.0000 - 2.0000i 2.0000 + 5.0000i 8.0000 + 2.0000i>> b=a.'b = 1.0000 + 2.0000i 2.0000 + 2.0000i 2.0000 - 5.0000i 8.0000 - 2.0000i>> conj(a')ans = 1.0000 + 2.0000i 2.0000 + 2.0000i 2.0000 - 5.0000i 8.0000 - 2.0000i三.關(guān)系運(yùn)算與邏輯運(yùn)算1.關(guān)系運(yùn)算>> a=-1 2 4; 5 3 9;b=4 0 2

15、;5 1 1;c=a>bc = 0 1 1 0 1 12.邏輯運(yùn)算(1)邏輯與>> a=2 3 4;1 6 3;b=2 3 1;6 5 4;c=a&bc = 1 1 1 1 1 1(2)邏輯或>> d=a|bd = 1 1 1 1 1 1(3)邏輯非>> e=ae = 0 0 0 0 0 0四.建立特殊數(shù)組1.用特殊函數(shù)建立數(shù)組>> zeros(5)ans = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>> pascal(8)ans = Columns 1 thro

16、ugh 5 1 1 1 1 1 1 2 3 4 5 1 3 6 10 15 1 4 10 20 35 1 5 15 35 70 1 6 21 56 126 1 7 28 84 210 1 8 36 120 330 Columns 6 through 8 1 1 1 6 7 8 21 28 36 56 84 120 126 210 330 252 462 792 462 924 1716 792 1716 34322.用小數(shù)組創(chuàng)建大數(shù)組>> a=1 1;2 3a = 1 1 2 3>> b=a,eye(2,3);ones(3,2),rand(3)b = 1.0000 1.

17、0000 1.0000 0 0 2.0000 3.0000 0 1.0000 0 1.0000 1.0000 0.7922 0.0357 0.6787 1.0000 1.0000 0.9595 0.8491 0.7577 1.0000 1.0000 0.6557 0.9340 0.74313.利用冒號建立數(shù)組>> x=1:5x = 1 2 3 4 5>> y=0:pi/4:piy = 0 0.7854 1.5708 2.3562 3.1416>> z=6:-1:1z = 6 5 4 3 2 14.空數(shù)組>> x=x = >> a=1 2 3;2 3 4a = 1 2 3 2 3 4四、實(shí)驗(yàn)總結(jié)此處正文(將在本次實(shí)驗(yàn)實(shí)習(xí)你的最大收獲是什么?通過實(shí)習(xí)你有什么想法?你對本次實(shí)習(xí)的看法和感想是什么?等寫在此)通過這次

溫馨提示

  • 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)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論