Matlab画图程序
%This creates 2 different plots,in 2 different windows
clf
x=1:5;
y1=[2 11 6 9 3];
y2=[4 5 8 6 2];
figure(1)
bar(y1)
figure(2)
plot(y1,'k')
hold
plot(y2,'ko')
grid
axis([1 6 2 11])
legend('y1','y2')
matlab使用plot画出向量为参数的图形默认是是折线图。
%This creates 2 different plots,in 2 different windows
clf
x=1:5;
y1=[2 11 6 9 3];
y2=[4 5 8 6 2];
figure(1)
bar(y1)
figure(2)
plot(y1,'k')
hold
plot(y2,'ko')
grid
axis([1 6 2 11])
legend('y1','y2')
matlab使用plot画出向量为参数的图形默认是是折线图。