Automated plot using values from an initial graph
Show older comments
I am trying to plot a graph using the the central minima values that are generated from an intial plot.
The attached images and code demonstrate what I am trying to achieve.
clear all;
%PARAMETERS
n1 = 3.43; n2 = 2.97; n0 = 1; n3 = 3.6;
c = 767e-9; l = 0e-9; u = 3000e-9;
figure;
CHARTS = tiledlayout('flow');
nexttile; grid on; grid minor; hold on
xlabel('Wavelength'); ylabel('Angle'); zlabel('Intensity')
zlim ([0 100]);
xlim ([700 800]);
for iRange = 80:-10:0
np = 20000; s = (u-l)/np;
Wavelength = zeros(1,np);
Intensity = zeros(1,np);
index = 1;
%WAVELENGTH RANGE
for range = l:s:u
incd = iRange*(pi/180);
a1 = asin((n0*sin(incd))/n1);
a2 = asin((n1*sin(a1))/n2);
a21 = asin((n2*sin(a2))/n1);
%WAVEVECTOR
k = 2*pi/range;
%THICKNESS
l1 = c/(4*n1);
l2 = c/(4*n2);
%MATRICES
A = [1 1;n0*cos(a1) -n0*cos(a1)];
B = [1 1;n1*cos(a21) -n1*cos(a21)];
C = [1 1;n2*cos(a2) -n2*cos(a2)];
D = [1 1;n3 -n3];
%PROPAGATION
X1 = [exp(1i*k*l1*n1*cos(a21)) 0;0 exp(-1i*k*l1*n1*cos(a21))];
X2 = [exp(1i*k*l2*n2*cos(a2)) 0;0 exp(-1i*k*l2*n2*cos(a2))];
%LAYER
L = X1*(B\C)*X2*(C\B);
M = (A\B)*(L^18)*X2*(L^21)*(B\D);
%REFLECTANCE
E1 = M(2,1)/M(1,1);
E2 = 100*(abs(E1)^2);
Intensity(index) = E2;
Wavelength(index) = range/1e-9;
index = index+1;
end
[Wv,In] = meshgrid(Wavelength,incd);
plot3(Wv,In,Intensity','linewidth',1)
view(-5,60); rotate3d('on');
end

Accepted Answer
More Answers (0)
Categories
Find more on Discrete Data Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!