资源描述:
《控制系统仿真(MATLAB)实验1-6.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、控制系统仿真(MATLAB)实验指导书青岛大学自动化工程学院2006年4月MATLAB实验一一、实验目的:1.BefamiliarwithMATLABEnvironment2.Befamiliarwitharrayandmatrix3.BefamiliarwithMATLABoperationsandsimpleplotfunction二、实验内容:1.BefamiliarwithMatlab6.5StartupMatlab6.5,browsethemajortoolsoftheMatlabdesktopnTheCommandWindowsnTheComm
2、andHistoryWindowsnLaunchPadnTheEdit/DebugWindownFigureWindowsnWorkspaceBrowserandArrayEditernHelpBrowsernCurrentDirectoryBrowser2.Givetheanswerofthefollowingquestionsforthearray1)Whatisthesizeofarray1?2)Whatisthevalueofarray1(4,1)?3)Whatisthesizeandvalueofarray1(:,1:2)?4)Whatisthe
3、sizeandvalueofarray1([13], end)?3.Givetheanswerofthefollowingcommad1)a=1:2:5;2)b=[a’a’a’];3)c=b(1:2:3,1:2:3);4)d=a+b(2,:)5)w=[zeros(1,3) ones(3,1)’ 3:5’]4.Givetheanswerofthesub-arrays1)array1(3,:);2)array1(:,3);3)array1(1:2:3,[334])4)array1([11],:)5.Givetheanswerofthefollowingoper
4、ations1)a+b2)a*d3)a.*d4)a*c5)a.*c6)ab7)a.b8)a.^b6.Solvethefollowingsystemofsimultaneousequationsforx7.Edit&Runthem-file%teststepresponsefunctionwn=6;kosi=[0.1:0.1:1.02];figure(1);holdonforkos=kosinum=wn^2;den=[1,2*kos*wn,wn.^2];step(num,den)endholdoff;8.Edit&Runthem-file%testplo
5、tfunctionx=0:pi/20:3*pi;y1=sin(x);y2=2*cos(2*x);plot(x,y1,'rv:',x,y2,'bo--');title('PlottheLineofy=sin(2x)anditsderivative');xlabel('Xaxis');ylabel('Yaxis');legend('f(x)','d/dxf(x)');gridon;9.Edit&Runthem-file%testsubplotandloglogfunctionx=0:0.1:10;y=x.^2-10.*x+26;subplot(2,2,1);p
6、lot(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;10.Edit&Runthem-file%testmaxandplotfunctionvolts=120;rs=50;rl=1:0.1:100;amps=volts./(rs+rl);pl=(amps.^2).*rl;[maxvol,index]=max(pl);plot(rl,pl,rl(index),pl(ind
7、ex),'rh');gridon;MATLAB实验二一、实验目的:1.Learntodesignbranchandloopstatementsprogram2.Befamiliarwithrelationalandlogicaloperators3.Practice2Dplotting二、实验内容:PARTI:(选择练习,不需提交实验报告)1.Holdcommandexercisenx=-pi:pi/20:pi;ny1=sin(x);y2=cos(x);plot(x,y1,'b-');holdon;nplot(x,y2,'k--');holdoff;nle
8、gend('sinx','cosx')2.Figurecomman