フィルターのクリア

Graph two curves in the same plane

1 回表示 (過去 30 日間)
Yordani
Yordani 2022 年 12 月 30 日
コメント済み: Walter Roberson 2022 年 12 月 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
  2 件のコメント
Yordani
Yordani 2022 年 12 月 30 日
Hello! Yes thank you very much :D
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022 年 12 月 30 日
Most welcome! Glad to help

サインインしてコメントする。

採用された回答

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')
  1 件のコメント
Walter Roberson
Walter Roberson 2022 年 12 月 30 日
in particular you had used real(e2) for both y1 and y2

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by