自己解决了,例如可以用以下实现:
x=0

i/50

i;
y1=sin(x);
y2=cos(x);
ax=plotyy(x,y1,x,y2);
%%%%%% 新加程序%%%%%%%%
ylim(ax(2),[-2 2])
ylabel(ax(2),'Y2 axis')
以下是matlab自带的例子,同样可以解决问题
>> x = 0:0.01:20;
y1 = 200*exp(-0.05*x).*sin(x);
y2 = 0.8*exp(-0.5*x).*sin(10*x);
[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',':')
希望这个帖子对大家有用拉:smile: