MATLAB: I have problem in plot

plot error

I have probelm in this code because it appear as discrete point not contious????
for er=[2,4.3,5.4,6.2,7.6,8.5,10.3,12] h=.16; con=10^7; lt=0.025; Zin=50; lambda_o=30.0/freq; ko=2.0*pi/lambda_o; F=8.791/(freq*sqrt(er)); a=F/sqrt(1+2*h/(pi*er*F)*(log(pi*F/(2*h))+1.7726)); ae=a*sqrt(1+2*h/(pi*er*a)*(log(pi*a/(2*h))+1.7726));

Best Answer

% F is a vector, use .* instead *
er=[2,4.3,5.4,6.2,7.6,8.5,10.3,12]
freq=1
h=.16; con=10^7;
lt=0.025;
Zin=50;
lambda_o=30.0/freq;
ko=2.0*pi/lambda_o;
F=8.791/(freq*sqrt(er));
a=F/sqrt(1+2*h/(pi*er*F)*(log(pi*F/(2*h))+1.7726)); % F is a vector, use .*
ae=a*sqrt(1+2*h/(pi*er*a)*(log(pi*a/(2*h))+1.7726));
freq=.1:.1:1;
er=4.3;
h=.16;
F=8.791./(freq*sqrt(er));
a=F./sqrt(1+2*h./(pi*er*F).*(log(pi*F/(2*h))+1.7726));
ae=a.*sqrt(1+2*h./(pi*er*a).*(log(pi*a/(2*h))+1.7726));
plot(freq,a,'-r',freq,ae,'-g')