matlab二维绘图

来源:互联网 发布:重庆大学软件学院 编辑:程序博客网 时间:2024/05/20 20:02
x = 0:0.01:2*pi;y = sin(x);figureplot(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('Time (\musec)') title('Multiple Decay Rates') set(H1,'LineStyle','--')set(H2,'LineStyle',':')

这里写图片描述

原创粉丝点击