




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)
文檔簡介
控制系統(tǒng)仿真(MATLAB)實驗指導(dǎo)書青島大學(xué)自動化工程學(xué)院2006年4月一、實驗?zāi)康模築efamiliarwithMATLABEnvironmentBefamiliarwitharrayandmatrixBefamiliarwithMATLABoperationsandsimpleplotfunction二、實驗內(nèi)容:BefamiliarwithMatlab6.5StartupMatlab6.5,browsethemajortoolsoftheMatlabdesktopTheCommandWindowsTheCommandHistoryWindowsLaunchPadTheEdit/DebugWindowFigureWindowsWorkspaceBrowserandArrayEditerHelpBrowserCurrentDirectoryBrowserGivetheanswerofthefollowingquestionsforthearray1.10.02.1-3.5array}-0.01.1-6.6 2.80.3-0.4—1.40.01.16.01.10.02.1-3.5array}-0.01.1-6.6 2.80.3-0.4—1.40.01.16.03.41.30.0_Whatisthesizeofarray1?Whatisthevalueofarray1(4,1)?Whatisthesizeandvalueofarray1(:,1:2)?Whatisthesizeandvalueofarray1([13],end)?Givetheanswerofthefollowingcommadl)a=l:2:5; 2)b=0a9a5];3)c=b(l:2:3,1:2:3);4)d=a+b(2,:)5)w=[zeros(l,3)ones(3,l)93:51Givetheanswerofthesub-arrays-6.62.83.40.3-0.41.3-6.62.83.40.3-0.41.30.01.10.00.01.1array}=2.10.1-1.45.11)array1(3,:);2)array1(:,3);3)array1(1:2:3,[334])4)arrayl([l1],:)Givetheanswerofthefollowingoperations2 -21ri-iirii,b= ,c-,d=eye(2)-12jL02J2_4)a*c
8)a.A4)a*c
8)a.Aba.*c 6)a\b 7)a.\bSolvethefollowingsystemofsimultaneousequationsforx—2.0X1+5.0x2+1.0尤3+3?014+4.0/-1.0x6—0.02.Ox,-1.0x2-5.0x3-2.0x4+6.0x5+4.0x6=1.0—1.0X1+6.0^2—4.0%3—5.0%4+3.0/一1?04=—6.0—4.0%]+3?0%2-6.0兄3—5.0%4—2.0%5—2.0%6=10.0—3.0%+6.0x?+4.0元3+2.0%4—6.0天+4?04=—6.02.0%+4.0%2+4.0工3+4.0工4+5.0/一4.0x6=~2.0Edit&Runthem-file%teststepresponsefunctionwn=6;kosi=[0.1:0.1:1.02];figure(l);holdonforkos=kosinum=wnA2;den=[l,2*kos*wn,wn.A2];step(num,den)endholdoff;Edit&Runthem-file%testplotfunctionx=0:pi/20:3*pi;yl=sin(x);y2=2*cos(2*x);plot(x,yl/rv:\x,y2/bo—1);title('PlottheLineofy=sin(2x)anditsderivative');xlabelfXaxis1);ylabel(!Yaxis');legend(*f(x)Vd/dxf(x),);gridon;Edit&Runthem-file%testsubplotandloglogfunctionx=0:0.1:10;y=x.A2-l0.*x+26;subplot(2,2,l);plot(x,y);gridon;subplot(2,2,2);semilogx(x,y);gridon;subplot(2,2,3);semilogy(x,y);gridon;subplot(2,2,4);loglog(x,y);gridon;Edit&Runthem-file%testmaxandplotfunctionvolts=120;rs=50;rl=l:0.1:100;amps=volts./(rs+rl);pl=(amps.A2).*rl;[maxvol,index]=max(pl);plot(rl,pl,rl(index),pl(index),,rh,);gridon;一、實驗?zāi)康模篖earntodesignbranchandloopstatementsprogramBefamiliarwithrelationalandlogicaloperatorsPractice2Dplotting二、實驗內(nèi)容:PARTI:(選擇練習(xí),不需提交實驗報告)Holdcommandexercisex=-pi:pi/20:pi;yl=sin(x);y2=cos(x);plot(x,yl,,b,);holdon;plot(x,y2,'k--');holdoff;legend('sinx',‘cosx')Figurecommandexercisefigure(l);subplot(2,l,l);x-pi:pi/20:pi;y=sin(x);plot(x,y);grsidon;titleC^ubplot1Title1);subplot(2,l,2);x-pi:pi/20:pi;y=cos(x);plot(x,y);gridon;titleC^ubplot2Title1);PolarPlotsexerciseg=0.5;theta=0:pi/20:2*pi;gain=2*g*(1+cos(theta));polar(theta,gain,'r-f);title('\fontsize{20}\bfGainversusangle\theta1);Comparethe3approachesfollows(LoopsandVectorization)%A.PerformcalculationbyForLoopwithpre-initializearraytic;square=zeros(l,l0000)%pre-initializearrayforii=l:10000square(ii)=iiA2;square_root(ii)=iiA(1/2);cube_root(ii)=iiA(l/3);endtoe;tl=toc%B.PerformcalculationbyForLoopwithoutpre-initializearraytic;forii=1:10000square(ii)=iiA2;square_root(ii)=iiA(1/2);cube_root(ii)=iiA(l/3);endtoe;t2=toc%C.Performcalculationwithvectorstic;ii=1:10000square(ii)=ii.A2;square_root(ii)=ii.A(1/2);cube_root(ii)=ii.A(l/3);endtoe;t3=tocPARTII:(需提交實驗報告)Assumethata,b,c,anddaredefined,andevaluatethefollowingexpression.a=20;b=-2;c=0;d=l;a>b;(2)b>d;(3)a>b&c>d;(4)a==b;(5)a&b>c;6)??b;a=2;b=[l-2;-010];c=[01;20];d=[-212;010];(7)?(a〉b)(8)a>c&b>c(9)c<=da=2;b=3;c=10;d=0;a*b八2〉a*c(11)d|b>a(12)(d|b)>aa=20;b=-2;c=0;d=9Tesf;isinf(a/b)(14)isinf(a/c)(15)a>b&ischar(d)(16)isempty(c)WriteaMatlabprogramtosolvethefunctiony(x)=In---,wherexisanumber<1.Useanif\-xstructuretoverifythatthevaluepassedtotheprogramislegal.Ifthevalueofxislegal,caculatey(x).Ifnot,writeasuitableerrormessageandquit.Writeoutm.fileandplotthefigureswithgridsAssumethatthecomplexfunctionf(t)isdefinedbytheequationf(t)=(0.5-0.25i)t-1.0Plottheamplitudeandphaseoffunctionfor0<f<4.WritetheMatlabstatementsrequiredtocalculatey(t)fromtheequation1—3/2+5/NOM="/<oforvalueoftbetween-9and9instepsof0.5.
溫馨提示
- 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)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- ktv水果配送合同范本
- 人力轉(zhuǎn)讓合同范本
- 倉庫維修維護合同范本
- 出國合同范本ps
- 樂器進貨合同范本
- 冰箱購買合同范例
- 單位清單合同范本
- 勞務(wù)服務(wù)發(fā)票合同范本
- 公司運貨合同范本
- 協(xié)力商合同范本
- 碳酸鈣脫硫劑項目可行性研究報告立項申請報告模板
- 山東省泰安市新泰市2024-2025學(xué)年(五四學(xué)制)九年級上學(xué)期1月期末道德與法治試題(含答案)
- 1《北京的春節(jié)》課后練習(xí)(含答案)
- (完整版)陸河客家請神書
- 2025年行業(yè)協(xié)會年度工作計劃
- DB3502T 160-2024 工業(yè)產(chǎn)品質(zhì)量技術(shù)幫扶和質(zhì)量安全監(jiān)管聯(lián)動工作規(guī)范
- 2025年學(xué)校教師政治理論學(xué)習(xí)計劃
- 集團專利管理制度內(nèi)容
- 燃氣農(nóng)村協(xié)管員培訓(xùn)
- 春節(jié)后復(fù)工安全教育培訓(xùn)
- 提高發(fā)票額度的合同6篇
評論
0/150
提交評論