Change x-axis values in a 2D graph

1 visualización (últimos 30 días)
Yordani
Yordani el 26 de Dic. de 2022
Respondida: Yordani el 26 de Dic. de 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

Respuesta aceptada

Yordani
Yordani el 26 de Dic. de 2022
thank you! :D

Más respuestas (1)

VBBV
VBBV el 26 de Dic. de 2022
Editada: VBBV el 26 de Dic. de 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'})

Categorías

Más información sobre Graph and Network Algorithms en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by