function partial(x,T,M)
%  partial(x,T,M)
% plot partial sums (up to sum of M)
% of the Fourier Series expansion of x(t) vs. t
	X=Fseries(x);
	L=1024;
	w=exp((2*pi*i/L)*[0:L-1]);
	mwt=ones(1,L);
	p=[real(X(1)*mwt)];
	t=(T/L)*[0:L-1];
	colors='ymcrgbk';
	c=1;
	plot(t,p,colors(c))
	hold on
	for m=[1:min(M,length(X)-1)]
		mwt=mwt.*w;
		p=p+2*real(X(m+1).*mwt);
		plot(t,p,colors(mod(c+m,length(colors))+1))
	end
	hold off
	xlabel('time in seconds')
	title('partial sums of Fourier series')		
	
