% Laplace transform of square using Heaviside functions

clear
syms t s n

% Create and plot 20 rectangular pulses
F=symsum(heaviside(t-2*n)-heaviside(t-(2*n+1)),n,0,20);
ezplot(F,[0 40 0 2])

% Compute transform
laplace(F)

% Inverse transform of exact transform of 
% symsum(heaviside(t-2*n)-heaviside(t-(2*n+1)),n,0,Inf);
pause

f=ilaplace(1/(s*(1+exp(-s/2))),s,t)
ezplot(f,[0 10 0 2])