Change Y axis values in a 2D chart

1 次查看(过去 30 天)
Hello! Could someone tell me how I can adjust my graph number 3 to be the same as number 4? I want to get the values of the Y axis in logarithmic scale but I don't know how to do it. Thank you
Graph 3
Graph 4
%Permitividad Parte Imaginaria
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) = (gamma*Wp^2/K(w)^3+K(w)*gamma^2);
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'})

采纳的回答

Voss
Voss 2022-12-26
Use loglog instead of semilogx. (And make appropriate changes to ylim.)

更多回答(0 个)

类别

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