Good morning, I am trying to plot this figure with the same code in Matlab. However it does not work at all. I simply can not get the same figure but instead using plotyy. The reason I need it with plotyy is make the reader understand the significance of the left hand numbers by plotting the same function but multiplied by a constant. The right hand side will be called the Gain and thus the reader will know at least how much gain is achieved for certain power. HEre is the code:
[![r=1:0.001:3;
R=50;
kappa=0.5;
L1=1000;
c1=R/(8*kappa*L1);
Frmin=(r+r.^-1).*(r-1)./(r+1);
Frmax=(r+r.^-1).*(atan(r)-atan(1./r));
P1min=c1.*Frmin;% the 1st function for the left hand side of plotyy
P1max=c1.*Frmax;% the 2nd function for the left hand side of plotyy
YYmin=P1min*20; % the 1st function for the right hand side of plotyy
YYmasx=P1max*20;% the 2nd function for the right hand side of plotyy
figure;
ha1 = area(\[1 3\], \[0 M.*c1\]);
hold on
plot(r,P1min,'r','Linewidth',8)
fill(\[r fliplr(r)\],\[P1min,fliplr(P1max)\],'y')
plot(r,P1max,'k','Linewidth',5);
hold off
legend('\Delta >0','\Delta=0', '\Delta<0','Pmax')
%,'900','800','700','600','500')
xlabel('r')
ylabel('P_p (W)')
title('P_p vs r for L= 1000 m')][1]][1]
So i hope I can get some help with this. I could show you some of my trials error attempts but then I would not be clear of my goal which is again to plot the same figure with same colors but using plotyy. Thank you and sorry for the long message.