X=0:.01:20;
Y1=200*exp(-.05*X).*sin(X);
Y2=.8*exp(-.5*X).*sin(10*X);
[AX,H1,H2]=plotyy(X,Y1,X,Y2,'plot');
set(get(AX(1),'Ylabel'),'String','Left Y-axis')
set(get(AX(2),'Ylabel'),'String','Right Y-axis')
xlabel('zero to 20 \musec.')
title('Labeling plotyy')
set(H1,'LineStyle','-')
set(H2,'LineStyle',':')
开发工具:MATLAB2022b
微信Alt+A截屏工具
本程序摘自《MATLAB 20085图形与动画实例教程》