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)
이전 댓글 표시
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)
답변 (1개)
Image Analyst
2013년 9월 13일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 Optics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!