Refer to the documentation of yyaxis for more information. I was getting two Y-axes when I tried your code:
x = 0:0.05:0.3333333;
S = rand(size(x));
D = rand(size(x))/2;
% yyaxis left
plot(x,S,"-r")
hold on
yyaxis right
plot(x, D, "-.b")
hold off
If you want to set the same limits for both the Y-axes then you can try as below:
plot(x,S,"-r")
hold on
yleftLimits = get(gca,'ylim')
yyaxis right
plot(x, D, "-.b")
set(gca,'ylim',yleftLimits)
hold off
If this is not the issue you are facing, can you clearly state your issue with an example.