You are on page 1of 1

Listing program pada MATLAB untuk membuat grafik fungsi transverse gambar 1.

1:

function [] = PassiveLowpassRC();

R=10000; %ohm

C=5*1e-7; %farad

w=logspace(0,10, 100);

H=1./(j*w*C*R+1); %H=Vout/Vin

a=20*log10(abs(H))

subplot (2,1,1);

h = semilogx(w,a,'r');

set (h, 'LineWidth', 2);

ylabel ('20 Log (Vout/Vin) (dB)');

xlabel ('Omega (Log)');

title ('Passive Lowpass RC Filter');

set (gca, 'Box', 'Off');

grid on;

set (gca, 'YLim', [-45 5]);

set (gca, 'XLim', [min (w) max(w)])

print ('PassiveLowpassRC', '-depsc');

You might also like