Change x-axis values in a 2D graph

1 vue (au cours des 30 derniers jours)
Yordani
Yordani le 26 Déc 2022
Réponse apportée : Yordani le 26 Déc 2022
Hello! Could someone please tell me how I can adjust my graph number 1 so that it is the same as number 2? I want the values of [0.1-1-10] to come out, but I don't know how to do it, I'm making the blue line. Thank you
G1
G2
e_inf = 1.0 ; %Valor Correcto
Wp = 1; %Valor Correcto
gamma = 1e-3; %Valor Correcto
w1 = 0.1; %Valor Correcto
w2 = 0.1; %Valor Correcto
w3 = 10; %Valor Correcto
index = 0;
for w = w1:w2:w3
index = index + 1 ;
e(index) = e_inf - (Wp^2/w^2+1i*w*gamma);
f(index) = w;
x = f ;
y = real(e);
plot(x,y)
xlim([0 10])
ylim([-1.5 1.5])
end

Réponse acceptée

Yordani
Yordani le 26 Déc 2022
thank you! :D

Plus de réponses (1)

VBBV
VBBV le 26 Déc 2022
Modifié(e) : VBBV le 26 Déc 2022
e_inf = 1.0 ; %Valor Correcto
Wp = 1; %Valor Correcto
gamma = 1e-3; %Valor Correcto
w1 = 0.1; %Valor Correcto
w2 = 0.1; %Valor Correcto
w3 = 10; %Valor Correcto
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)
xlim([0 10])
ylim([-1.5 1.5])
grid
xticklabels({'0.1','1','10'})

Catégories

En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by