subplot(3, 1, 1); plot(t, y) subplot(3, 1, 2 ); plot(t, y3 subplot(3, 1, 3) plot(t, y2)
subplot(3,1,1); plot(t,y) subplot(3,1,2); plot(t,y3) subplot(3,1,3); plot(t,y2) 0 1 2 3 4 5 6 7 -1 0 1 0 1 2 3 4 5 6 7 -1 0 1 0 1 2 3 4 5 6 7 -1 0 1
subplot('position, [ left bottom width height) 0.5 0.5 0 0 0.5 0.5 2 0 2 0.5 0 -0.5 0 0.5 1.5 2.5
subplot('position',[left bottom width height]) 0 1 2 3 -1 -0.5 0 0.5 1 0 1 2 3 -1 -0.5 0 0.5 1 0 0.5 1 1.5 2 2.5 3 -1 -0.5 0 0.5 1
4.多窗口绘图 figure(n)创建窗口函数,n为窗 口顺序号 t=0:pi/100:2*pi; y=sin(t); y1=sin(t+0. 25): y2=Sin(t+0.5); plot(t, y)-—自动出现第一个窗口 figure(2) plot(t,y1)在第二窗口绘图 figure (3) plot,y2)在第三窗口绘图
4. 多窗口绘图 figure(n) —— 创建窗口函数,n为窗 口顺序号。 t=0:pi/100:2*pi; y=sin(t);y1=sin(t+0.25);y2=sin(t+0.5); plot(t,y) —— 自动出现第一个窗口 figure(2) plot(t,y1) —— 在第二窗口绘图 figure(3) plot(t,y2) ——在第三窗口绘图
08 4 42
0 1 2 3 4 5 6 7 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 0 1 2 3 4 5 6 7 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 0 1 2 3 4 5 6 7 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
5可任意设置颜色与线型 例4(例2):plot,y,r,t,y1,gty2,b*) 0.8 06 0.4 0.6 0.8
5.可任意设置颜色与线型 例 4(例2):plot(t,y,'r-',t,y1,'g:',t,y2,'b*') 0 1 2 3 4 5 6 7 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1