Problems with the Y axis of my 2D graph
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yordani
el 30 de Dic. de 2022
Editada: Sulaymon Eshkabilov
el 30 de Dic. de 2022
Hello! Could someone please help me, I want my graph 1 to look like graph 2 but I don't know how to fix the Y axis. :(
it's for the blue line.
1)
2)
My code:
%Permitividad Parte Real
e_inf = 11.7 ;
Wp = 1.0856e11;
gamma = 2.3518e9 ;
w1 = 1e13;
w2 = 1e13;
w3 = 1e15;
index = 0;
K = w1:w2:w3;
for w = 1:length(K)
index = index + 1 ;
e(index) = e_inf - (Wp^2/K(w)^2+1i*K(w)*gamma);
f(index) = K(w);
x(index) = f(index) ;
y(index) = real(e(index));
end
semilogx(x,y)
0 comentarios
Respuesta aceptada
Sulaymon Eshkabilov
el 30 de Dic. de 2022
Editada: Sulaymon Eshkabilov
el 30 de Dic. de 2022
Take smaller step size for w, eg.:
e_inf = 11.7 ;
Wp = 1.0856e11;
gamma = 2.3518e9 ;
w1 = 1e11;
w2 = 1e10;
w3 = 1e15;
index = 0;
K = w1:w2:w3;
for w = 1:length(K)
index = index + 1 ;
e(index) = e_inf - (Wp^2/K(w)^2+1i*K(w)*gamma);
f(index) = K(w);
x(index) = f(index) ;
y(index) = real(e(index));
end
semilogx(x,y, 'linewidth', 2), grid on
% It is better to use this syntax of the code:
e_inf = 11.7 ;
Wp = 1.0856e11;
gamma = 2.3518e9 ;
w1 = 1e11;
w2 = 1e10;
w3 = 1e15;
index = 0;
K = w1:w2:w3;
% Loop is not necessary!
e = e_inf - ((Wp^2)./K.^2+1i*K*gamma);
f=K;
x=f;
y = real(e);
semilogx(x,y, 'linewidth',2), grid on
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Graph and Network Algorithms en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!