1个回答
展开全部
假设你的y1 y3用左边的坐标轴,y2,y4用右边的坐标轴:
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
y3 = y1+40;
y4 = y2+0.3;
figure;
hold on;
[AX,h1,h2] = plotyy(x,y1,x,y2,'plot');
[~,h3,h4] = plotyy(x,y3,x,y4,'plot');
set(h1,'LineStyle','--','Color','r');
set(h2,'LineStyle',':','Color','k');
x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
y3 = y1+40;
y4 = y2+0.3;
figure;
hold on;
[AX,h1,h2] = plotyy(x,y1,x,y2,'plot');
[~,h3,h4] = plotyy(x,y3,x,y4,'plot');
set(h1,'LineStyle','--','Color','r');
set(h2,'LineStyle',':','Color','k');
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询