% Math 3150 Fall 2008
%
% Problem 3.3.3
thickLines (3) ; 
% remove if is not in your system 
% space variable
x = linspace (0 ,1) ;
% time variable will take values in this array
nts = 21; % number of times at which to plot string
ts=linspace (0 ,2*pi , nts ) ;
cols = hsv( nts ) ; % colors with which to plot string
figure (1) ; clf ;
hold on ;
for
it =1:length( ts ) , % for every time
t = ts ( it ) ;
% we don't need to loop over the number of terms
% the sum has only a few terms
s = sin (pi*x)*cos( t ) + 3*sin (2*pi*x)*cos(2* t ) -
sin (5*pi*x)*cos(5* t ) ;
h=plot(x , s ) ; % plot the partial sum
set (h, 'color' , cols ( it , : ) ) ;
% adjust axis so that all plots are on the same scale
axis ([0 1 -5 5]) ;
%pause ;
end;
hold off ;
filename='p3_3_3.eps' ;
print( '-depsc2' , filename ) ;
system ([ 'epstopdf ' , filename ]) ;

