Matlab画图小问题

来源:百度知道 编辑:UC知道 时间:2024/09/22 22:25:10
如何用matlab画y=Cos(w*t),w=pi/6,2*pi/6,3*pi/6,4*pi/6,5*pi/6,6*pi/6,0<=t<=10,六幅图,使其排成2行3列,并把这六幅图画在一起啊。

t=0:pi/6:10;
subplot(2,3,1);
plot(t,cos(pi/6*t))
这里subplot(m,n,p)中m表示分割图形的行数,n表示列数,按照你所说的2行3刘,则设置m为2,n为3.p表示第一幅图。下面的plot(t,cos(pi/6*t))图就将显示在图形1位置,重复以上过程 p一次为2,3,4,5,6

subplot