< Code >
pi = 3.14159;
x = [-2*pi:pi/200:2*pi];
a = 20;
hFig = figure(1);
subplot(2,1,1);
y = abs(sinc(x) .* cos(x/5));
plot(x,y,'b-','linewidth',2); grid on; xlabel('x'); ylabel('y');
xlim([-2*pi 2*pi]);
ylim([0 1]);
subplot(2,1,2);
y = a * log10(abs(sinc(x) .* cos(x/5)));
plot(x,y,'b-','linewidth',2); grid on; xlabel('x'); ylabel('y');
xlim([-2*pi 2*pi]);
ylim([-80 0]);
%set(gca,'xtick',1:1:10);
pos = [(i/50.0) 0.01 (1.0/50.0) 0.98];
set(hFig,'Position',[300 400 800 500])
|