Graph two curves in the same plane

1 次查看(过去 30 天)
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

采纳的回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022-12-30
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')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by