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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1243682/image.png)
G2
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1243687/image.png)
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
0 个评论
采纳的回答
更多回答(1 个)
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'})
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graph and Network Algorithms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!