一:二维平面绘图
画出y=sin(x)的图像
x=0:0.01:2*pi;
y=sin(x);
figure
plot(x,y);
title('y=sin(x)')
xlabel('x')
ylabel('sin(x)')
xlim([0 2*pi])
在同一幅中画两图
x=0:0.01:20;
y1=200*exp(-0.05*x).*sin(x);
y2=0.8*exp(-0.5*x).*sin(10*x);
figure
[AX,H1,H2]=plotyy(x,y1,x,y2,'plot');
set(get(AX(1),'Ylabel'),'String','Slow decay')
set(get(AX(2),'Ylabel'),'String','Fast decay')
xlabel('line (\musec)')
title('Multiple decay rates')
set(H1,'linestyle','--')
set(H2,'linestyle',';')
二:三维立体绘图