资源描述:
《东南大学Matlab作业2》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、MatlabWorksheet2PartA(In-classroomexercises)1.Usingplottodisplaythefollowingvoltagewithappropriatelinetype,titleandlabels.Alsopresentthegraphwithsuitablerangesofaxis.wheref=50Hz.(Hint:timeintervalmustbesmallenough,e.g.0.001seconds.Therefore,t=0:0.001:1isappropriate);Answer:Home_work_2_A_1.m%l
2、bsin-class-exercise1_12013/8/21%functionUsingplottodisplaythefollowingvoltagewithappropriatelinetype,titleandlabels.Alsopresentthegraphwithsuitablerangesofaxis.%v(t)=220sin(2??ft)%wheref=50Hz.%Comment/loopclearall;closeall;t=0:0.001:1;v=220*sin(2*pi*50*t);plot(t,v,'m','LineWidth',2)xlabel('t(
3、sec)')ylabel('v(voltage)')title('v(t)=220sin(2??ft)')axis([00.2-260260]);gridon;1.Usingplottodisplaythefollowingvoltagewithappropriatelinetype,titleandlabels.Alsopresentthegraphwithsuitablerangesofaxis.wheref=50Hz.Inaddition,onthesamegraph,drawtheenvelopeoftheoscillationandaddlegends.Answer:h
4、ome_work_2_A_2.m%lbsin-class-exercise1_22013/8/21%functionUsingplottodisplaythefollowingvoltagewithappropriatelinetype,titleandlabels.Alsopresentthegraphwithsuitablerangesofaxis.%v(t)=220exp(-5t)cos(2??ft)%wheref=50Hz.%Inaddition,onthesamegraph,drawtheenvelopeoftheoscillationandaddlegends.%Co
5、mment/loopclearall;closeall;t=0:0.001:1;v=220*exp(-5*t).*sin(2*pi*50*t);plot(t,v,'m','LineWidth',2);xlabel('t(sec)')ylabel('v(voltage)')title('v(t)=220exp(-5t)cos(2??ft)')holdon;v1=220*exp(-5*t);plot(t,v1,'b','LineWidth',2);holdon;plot(t,-v1,'b','LineWidth',2);holdoff;legend('theoscillation',
6、'theenvelopeoftheoscillation');axis([01-220220]);gridon;1.Usesubplot,drawa2by2arrayofplotsforthefollowingfunctions:Applyappropriatelinetype,title,labelsandaxisrangesforthegraphs.Answer:home_work_2_A_3.m%lbsin-class-exercise1_32013/8/21%functionUsesubplot,drawa2by2arrayofplotsforthefollowingfu
7、nctions:%v1=cos(10*pi*t);v2=exp(-5*t).*v1;v3=exp(-10*t).*v1;v4=exp(-20*t).*cos(10*pi*t)%Applyappropriatelinetype,title,labelsandaxisrangesforthegraphs.%Comment/loopt=0:0.001:1;v1=cos(10*pi*t);v2=exp(-5*t).*v1;v3=exp(-10*t).*v1;v4=exp(-20*t).*