Can someone help me graph these two outputs from a for loop??
Mostrar comentarios más antiguos
I believe i need to put them into an array then graph it, but i really do no know. i need to recreate the graph below, just the green and red lines. I have also attatched a link to a google drive file with all the other files that you would need to run this code. these files are ec.txt, and all the files that calcmie calls while it is running. I need both C.ext and C2.ext graphed.
close all
clc
clear
b = 70e-9;
a = 49e-9;
epsilon_b=1;
epsilon_b2=1.9;
s=.5;
m = load('ec.txt');
n = 1
for n = 1:96
x=m(n,1)
y=m(n,2)
z=m(n,3)
lambda=x*1e-6
epsilon_c=y+1i*z
epsilon_s=(1-s)*epsilon_b+s*epsilon_c;
epsilon_s2=(1-s)*epsilon_b2+s*epsilon_c;
r = [a b];
ns = sqrt([epsilon_c epsilon_s]);
ns2 = sqrt([epsilon_c epsilon_s2]);
nm = sqrt(epsilon_b);
nm2 = sqrt([epsilon_b2]);
[S,C] = calcmie(r, ns, nm, lambda);
[S,C2] = calcmie(r, ns2, nm2, lambda);
C.ext
C2.ext
end
loglog(lambda,C.ext,'g')

Respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!