Normal and Grid on420-2-4-20Image and Box off20-2-10110.50-0.5-1-1220-2-2Equal420-2-4-2Square020Tight2Image and Fill20-201-101图5.2-3 各种轴控制指令的不同影响
【例5.2-4】
clf;t=0:pi/50:2*pi; y=sin(t); plot(t,y)
axis([0,2*pi,-1.2,1.2])
text(pi/2,1,'\\fontsize{16}\\leftarrow\\itsin(t)\\fontname{隶书}极大值') title('y=sin(t)') xlabel('t') ylabel('y')
6
y=sin(t)10.80.60.40.20-0.2-0.4-0.6-0.8-10123t456?sin(t)极大值y图 5.2-4 试验标识的图形
【例5.2-5】
clf;t=6*pi*(0:100)/100;
y=1-exp(-0.3*t).*cos(0.7*t);
plot(t,y,'r-','LineWidth',3) hold on
tt=t(find(abs(y-1)>0.05));ts=max(tt); plot(ts,0.95,'bo','MarkerSize',10) hold off
axis([-inf,6*pi,0.6,inf])
set(gca,'Xtick',[2*pi,4*pi,6*pi],'Ytick',[0.95,1,1.05,max(y)]) set(gca,'XtickLabel',{'2*pi';'4*pi';'6*pi'}) set(gca,'YtickLabel',{'0.95';'1';'1.05';'max(y)'}) grid on
text(13.5,1.2,'\\fontsize{12}{\\alpha}=0.3') text(13.5,1.1,'\\fontsize{12}{\\omega}=0.7') cell_string{1}='\\fontsize{12}\%uparrow'; cell_string{2}='\\fontsize{16} \\fontname{隶书}镇定时间'; cell_string{3}='\\fontsize{6} '; cell_string{4}=['\\fontsize{14}\\rmt_{s} = ' num2str(ts)];
text(ts,0.85,cell_string,'Color','b','HorizontalAlignment','Center') title('\\fontsize{14}\\it y = 1 - e^{ -\\alpha t}cos{\\omegat}') xlabel('\\fontsize{14} \\bft \\rightarrow') ylabel('\\fontsize{14} \\bfy \\rightarrow')
7
y = 1 - e -? tcos?tmax(y)?=0.3?=0.71.051 y ?0.95? 镇定时间ts = 9.6133 2*pi4*pi6*pi t ?图 5.2-5 二阶阶跃响应图的标识
5.2.3
【例5.2-6】
多次叠绘、双纵坐标和多子图
t=2*pi*(0:20)/20;
y=cos(t).*exp(-0.4*t);
stem(t,y,'g','Color','k'); hold on
stairs(t,y,':r','LineWidth',3) hold off
legend('\\fontsize{14}\\it stem','\\fontsize{14}\\it stairs') box on
8
1 0.8 stem stairs0.60.40.20-0.2-0.4 01234567图5.2-6 离散信号的重构
【例5.2-7】
clf;dx=0.1;x=0:dx:4;y=x.*sin(x);
s=cumtrapz(y)*dx;
a=plotyy(x,y,x,s,'stem','plot'); text(0.5,1.5,'\\fontsize{14}\\ity=xsinx')
sint='{\\fontsize{16}\\int_{\\fontsize{8}0}^{ x}}'; ss=['\\fontsize{14}\\its=',sint,'\\fontsize{14}\\itxsinxdx']; text(2.5,3.5,ss)
set(get(a(1),'Ylabel'),'String','被积函数 \\ity=xsinx') set(get(a(2),'Ylabel'),'String',ss) xlabel('x')
9
54s=? xxsinxdx0y=xsinx02被积函数 y=xsinx-500.511.52x2.533.504s=? xxsinxdx0图 5.2-7 函数和积分
【例5.2-8】
clf;t=(pi*(0:1000)/1000)';
y1=sin(t);y2=sin(10*t);y12=sin(t).*sin(10*t); subplot(2,2,1),plot(t,y1);axis([0,pi,-1,1]) subplot(2,2,2),plot(t,y2);axis([0,pi,-1,1]) subplot('position',[0.2,0.1,0.6,0.40]) plot(t,y12,'b-',t,[y1,-y1],'r:') axis([0,pi,-1,1]) 10.50-0.5-110.50-0.5-1010.50-0.5-1123012300.511.522.53图 5.2-8 多子图的布置
10
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库ch5 - 可视化2010a(2)在线全文阅读。
相关推荐: