% MATH 3150 Fall 2008
% Problem 2.2.11
thickLines (3) ; % remove if you don't have this in your system
figure(1);clf ;
x = linspace(-pi,3*pi,1000) ;
% plot true function for reference
hold on ;
plot(x, sin(x).^2) ;
axis([-pi ,3*pi ,0 ,1]) ;
% loop over number of terms
plot(x,1/2* ones(size(x)),'r') ;
plot(x,1/2*(1-cos(2*x)),'g') ;
filename = 'p2_2_11.eps' ;
xlabel('x') ;
print( '-depsc2' , filename ) ;
system (['epstopdf ',filename]) ;
