Change x-axis values in a 2D graph

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

采纳的回答

Yordani
Yordani 2022-12-26
thank you! :D

更多回答(1 个)

VBBV
VBBV 2022-12-26
编辑:VBBV 2022-12-26
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'})

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by