You are on page 1of 7

%Transformasi Laplace

% a) Transformasi
syms t a ;
A=cos(a*t);
laplace(A)

syms t;
B=sqrt(t);
laplace(B)

% b) Invers
syms a b s ;
C=(s-a)/(((s-a)^2)+(b^2));
ilaplace(C)

syms s;
D=1/s;
ilaplace(D)

>> responsi3

ans =

s/(a^2 + s^2)

ans =
pi^(1/2)/(2*s^(3/2))

ans =

exp(a*t)*cosh(b*t*1i)

ans =

1
clc
subplot (3,1,1)
t=0:.001:2;
f=100;
x_t=cos(2*pi*4*t);
plot(x_t,'r');
xlabel('waktu domain')
axis([0 2010 -2.2 2.2])
grid on;
subplot (3,1,2)
x_f=fft(x_t);
plot(abs(x_f));
xlabel('domain frekuensi')
axis([-100 2100 -2100 2100])

subplot (3,1,3)
x_tt=ifft(x_f);
plot(x_tt);
xlabel('domain waktu')
axis([0 2010 -2.2 2.2])
clc;clear all;clf;
f=0;
x=linspace(0,6,1000);
for n=1:2:15;
X=[0,0,1,1,2,2,3,3,4,4,5,5,6,6]
Y=[0,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,0];
line (X,Y,'color','r','linewidth',2)
grid on; hold on;
f=f+(4/(n*pi))*sin(pi*n*x);
error=mean((abs(f)-1).^2);
plot(x,f,'k','linewidth',2)
title(['square wave FS Partial sum: ',...
'n=',num2str(n),'error=',num2str(error)])
pause
if error<0.01
break
end
clf
end

You might also like