Azzera filtri
Azzera filtri

how to get the correct plot from this matlab code? correct plot is a gaussian type but i am getting a straight line.given (e1=1 and e2=0) or (e1=0 and e2=1)

1 visualizzazione (ultimi 30 giorni)
i am writing the comlete code below.
e1=input('enter the value of ei1')
e2=input('enter the value of ei2')
w=1.5:0.01:1.6;
k1=0.25;
k2=0.25;
a=0.0005;
ne=2.5;
r=1.5*10^-6;
l=2*pi*r;
kn=(2*pi*ne*l)./w;
ed=e2*((sqrt(1-k2)-sqrt(1-k1)*exp(-a.*l-j*kn*l))./(1-sqrt(1-k1)*sqrt(1-k2)*exp(-a.*l-j*kn*l)))+e1*((-sqrt(k1-k2)*exp(a*l/2-(j*kn*l)/2))./(1-sqrt(1-k1)*sqrt(1-k2)*exp(-a.*l-j*kn*l)));
y=abs(ed);
z=y.^2; if true % code end plot(w,z)

Risposte (1)

Image Analyst
Image Analyst il 13 Set 2013
Like I said in your duplicate post, it's not straight - it just looks that way like any curve will if you look over a small enough section of it.

Categorie

Scopri di più su Christmas / Winter in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by