Borrar filtros
Borrar filtros

Graph two curves in the same plane

1 visualización (últimos 30 días)
Yordani
Yordani el 30 de Dic. de 2022
Comentada: Walter Roberson el 30 de Dic. de 2022
Hello! I'm trying to graph the function e1 and e2 in the same plane but I can't. Could you please help me :(
%Permitividad Parte Real
e_inf = 11.7 ;
Wp1 = 1.0856e11;
gamma1 = 2.3518e9 ;
Wp2 = 3.4330e11;
gamma2 = 5.6747e9 ;
w1 = 1e11;
w2 = 1e10;
w3 = 1e15;
index = 0;
K = w1:w2:w3;
% Loop is not necessary!
e1 = e_inf - ((Wp1^2)./K.^2+1i*K*gamma1);
e2 = e_inf - ((Wp2^2)./K.^2+1i*K*gamma2);
f=K;
x=f;
y1 = real(e2);
semilogx(x,y1, 'linewidth',2), grid on
hold on
y2 = real(e2);
semilogx(x,y2, 'linewidth',2), grid on
hold off
  2 comentarios
Yordani
Yordani el 30 de Dic. de 2022
Hello! Yes thank you very much :D
Sulaymon Eshkabilov
Sulaymon Eshkabilov el 30 de Dic. de 2022
Most welcome! Glad to help

Iniciar sesión para comentar.

Respuesta aceptada

Sulaymon Eshkabilov
Sulaymon Eshkabilov el 30 de Dic. de 2022
To plot two curves are simple as follows:
e_inf = 11.7 ;
Wp1 = 1.0856e11;
gamma1 = 2.3518e9 ;
Wp2 = 3.4330e11;
gamma2 = 5.6747e9 ;
w1 = 1e11;
w2 = 1e10;
w3 = 1e15;
index = 0;
K = w1:w2:w3;
% Loop is not necessary!
e1 = e_inf - ((Wp1^2)./K.^2+1i*K*gamma1);
e2 = e_inf - ((Wp2^2)./K.^2+1i*K*gamma2);
f=K;
x=f;
figure
y1 = real(e1);
semilogx(x,y1, 'r-','linewidth',2, 'displayName', 'e_1')
hold on
y2 = real(e2);
semilogx(x,y2, 'b-', 'linewidth',2,'displayName', 'e_2'), grid on
hold off
legend('toggle')
  1 comentario
Walter Roberson
Walter Roberson el 30 de Dic. de 2022
in particular you had used real(e2) for both y1 and y2

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by