Change Y axis values in a 2D chart

조회 수: 4 (최근 30일)
Yordani
Yordani 2022년 12월 26일
답변: Voss 2022년 12월 26일
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