semilogy()
和log10()
画图看起来一样
clc;clear all;close all;
f=-4:0.001:4;
X=abs(sinc(f));
plot(f,X);
figure(2)
semilogy(f,X);
axis([-4 4 0.001 1.1]);
set(gca,'YTickLabel',{'-80' '-40' '-20' '0'})
xlabel('Frequency(Hz)');
ylabel('Amplitude(dB)');
grid on
figure(3)
y=log10(X);
plot(f,log10(X));
ylim([0 2])
axis([-4 4 -3 0]);
set(gca,'YTickLabel',{'10^-3' '10^-2.5' '10^-2' '10^-1.5' '10^-1' '10^-0.5' '10^-0'});
grid on
网友评论