考虑以下示例。两个y轴之间的线型和位置要求在注释中。
Fs1 = 5;
Fs2 = 25;
t1 = (0:1:19)/Fs1;
t2 = (0:1:19)/Fs2;
fc = 5;
y11 = sin(2*pi*fc*t1); % In left y axis with style 'o' | legend entry - 'raw signal'
y12 = 2*sin(2*pi*fc*t2); % In left y axis with style '--' | legend entry - 'upsampled signal'
y21 = 5; % In right y axis with style ':' | legend entry - 'DC'