Why am I not getting the plot results?

1 回表示 (過去 30 日間)
Aravind Varma
Aravind Varma 2019 年 5 月 19 日
編集済み: madhan ravi 2019 年 5 月 19 日
c = 3e8;
h = 50e-9;
ramd = 633.0d-9;
omega = 2*pi/ramd*c;
e2 = 1;
enpr = 1.723;
e1 = -11.67345024 + 1i*1.1809292;
theta = 35*pi/180: 0.001 : 45*pi/180;
rpr1 = (cos(theta)/enpr - sqrt((e1-enpr^2*sin(theta).^2)/e1)) / (cos(theta)/enpr + sqrt(e1-enpr^2*sin(theta).^2)/e1);
r12 = (sqrt(e1-enpr^2*sin(theta).^2)/e1 - sqrt(e2-enpr^2*sin(theta).^2)/e2) / (sqrt(e1-enpr^2*sin(theta).^2)/e1 + sqrt(e2-enpr^2*sin(theta).^2)/e2);
alpha = 2*omega/c*h*sqrt(e1-enpr^2*sin(theta).^2)*1i;
R = (rpr1 + r12*exp(alpha))/(1 + rpr1*r12*exp(alpha));
t = theta/pi*180;
plot(t,abs(R));

採用された回答

madhan ravi
madhan ravi 2019 年 5 月 19 日
編集済み: madhan ravi 2019 年 5 月 19 日
The below code produces plot as you expect:
c = 3e8;
h = 50e-9;
ramd = 633.0d-9;
omega = 2.*pi/ramd*c;
e2 = 1;
enpr = 1.723;
e1 = -11.67345024 + 1i*1.1809292;
theta = 35*pi/180: 0.001 : 45*pi/180;
rpr1 = (cos(theta)./enpr - sqrt((e1-enpr.^2.*sin(theta).^2)./e1)) ./ (cos(theta)./enpr + sqrt(e1-enpr.^2.*sin(theta).^2)./e1);
r12 = (sqrt(e1-enpr.^2.*sin(theta).^2)./e1 - sqrt(e2-enpr.^2.*sin(theta).^2)./e2) ./ (sqrt(e1-enpr.^2.*sin(theta).^2)./e1 + sqrt(e2-enpr.^2.*sin(theta).^2)./e2);
alpha = 2.*omega./c.*h.*sqrt(e1-enpr.^2.*sin(theta).^2).*1i;
R = (rpr1 + r12.*exp(alpha))./(1 + rpr1.*r12.*exp(alpha));
t = theta./pi*180;
plot(t,abs(R));

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by