www.gusucode.com > matlab通信工程仿真源码(张德丰等编著)程序书籍 > matlab_code/matlab通信工程仿真源码(张德丰等编著)/第4章/li4_7.m

    t=(0:10:360)*pi/180;y=sin(t);
subplot(2,1,1),plot(t,y)
subplot(2,2,3),stem(t,y)
subplot(2,2,4),polar(t,y)
t=(0:10:360)*pi/180;y=sin(t);
subplot(2,1,1),plot(t,y)
subplot(2,2,3),stem(t,y)
subplot(2,2,4),polar(t,y)
y2=cos(t);y3=y.*y2;
plot(t,y,'—or',t,y2,'-.h',t,y3,'-xb')
xlabel('时间')
ylabel('幅值')
axis([-1,8,-1.2,1.2]);
%还可以进一步对第2行、第2列的部分进行再分割(如图4-9):
t=(0:10:360)*pi/180;y=sin(t);
subplot(2,1,1),plot(t,y)
subplot(2,2,3),stem(t,y)
subplot(2,2,4),polar(t,y)
%以上命令绘制图2-10
y2=cos(t);y3=y.*y2;
plot(t,y,'—or',t,y2,'-.h',t,y3,'-xb')
xlabel('时间')
ylabel('幅值')
axis([-1,8,-1.2,1.2]);
%增加以上5行命令绘制图4-9
subplot(4,4,11),fill(t,y,'r')
subplot(4,4,12),plot(t,y,'r')
subplot(4,4,15),plot(t,y2,'r')
subplot(4,4,16),plot(t,y3,'r')