clear
tstep = 0.001;

tt = -1.0:tstep:1.0;
%period
T0 = 0.2;
%fundamental frequency
f0 = 1/T0;

A1 = sin(2*pi*tt/T0);
Hp1 = plot(tt,A1);
set(Hp1,'LineWidth',2)
Ha = gca;
set(Ha,'Fontsize',16)
Hx=xlabel('Time, seconds');
set(Hx,'FontWeight','bold','Fontsize',16)
Hx=ylabel('Voltage (volts)');
set(Hx,'FontWeight','bold','Fontsize',16)
pause
A2 = -0.5*sin(2*pi*2*tt/T0);
A3 = sin(2*pi*3*tt/T0)/3.0;
A4 = -sin(2*pi*4*tt)/4.0;
A5 = sin(2*pi*5*tt)/5.0;

B = A1+A2+A3+A4+A5;
%M=10;
%A = zeros(M,2001);
%for m = 1:M
%    A(m,:) = -1*sin(2*pi*5*m*tt)*((-1)^m)/(m);
%end
%B = sum(A);
Hp1 = plot(tt,B)
axis([0 0.5 -5 5])
set(Hp1,'LineWidth',2)
Ha = gca;
set(Ha,'Fontsize',16)
Hx=xlabel('Time, seconds');
set(Hx,'FontWeight','bold','Fontsize',16)
Hx=ylabel('Voltage (volts)');
set(Hx,'FontWeight','bold','Fontsize',16)
pause
