clear all
clf
set(0,'defaultaxesfontsize',20);
t=-7:.01:7;
Nmax=20;
x=zeros(size(t));
ik=0;
for k=-Nmax:Nmax,
    if k==0, x=x+ones(size(x)); ik=ik+1; c(ik)=1;
    else
        ik=ik+1;
    c(ik)=(3/(2*k*pi))^2*(1-exp(-j*2*k*pi/3));
 x=x+c(ik)*exp(j*2*pi*k*t/3);
    end
end
figure(1)
plot(t,real(x),'linewidth',2)
set(gca,'XTick',[-8:8])
axis([-7 7 0 3]);
hold on
plot([-7 7],[0 0],'k','linewidth',2);
plot([0 0],[0 3],'k','linewidth',2);
hold off
figure(2)
stem(-Nmax:Nmax,abs(c),'linewidth',2)