0

Consider the following example. The requirements for line style and placement among the two y axises are in the comments.

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'
Naveen
  • 458
  • 1
  • 10
  • 29
  • 1
    I wouldn't bother using `plotyy`. I recommend stacking axes on top of the other and specify the axes to plot to. See [this answer](http://stackoverflow.com/questions/28634426/create-an-xy-plot-with-two-y-axis/28634655#28634655) – sco1 Sep 01 '16 at 15:33
  • are you sure that the fc belongs into the sin()? from your comments i feel like its rather part of the amplitude than the frequency – Finn Sep 02 '16 at 11:39

0 Answers0