Why am I not getting the plot results?

2 visualizzazioni (ultimi 30 giorni)
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));

Risposta accettata

madhan ravi
madhan ravi il 19 Mag 2019
Modificato: madhan ravi il 19 Mag 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));

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by