Problems with the Y axis of my 2D graph

1 回表示 (過去 30 日間)
Yordani
Yordani 2022 年 12 月 30 日
編集済み: Sulaymon Eshkabilov 2022 年 12 月 30 日
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)

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022 年 12 月 30 日
編集済み: Sulaymon Eshkabilov 2022 年 12 月 30 日
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 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by