Why am I not getting the plot results?

1 Ansicht (letzte 30 Tage)
Aravind Varma
Aravind Varma am 19 Mai 2019
Bearbeitet: madhan ravi am 19 Mai 2019
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));

Akzeptierte Antwort

madhan ravi
madhan ravi am 19 Mai 2019
Bearbeitet: madhan ravi am 19 Mai 2019
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));

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by