T=6;
w0=2*pi/T;
t=0:0.01:6;
N=1000;
xt=zeros(1,length(t));
for k=0:N
xk=-1./(3*j*(k+0.0001)*w0).*(exp(-j*(k+0.0001)*w0*2)+exp(-j*(k+0.0001)*w0*4)-2);

xt=xt+xk*exp(j*(k+0.0001)*w0*t);

plot(t,xt)
pause(0.0001)
end

