% % Written by: % -- % John L. Weatherwax 2007-03-30 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- close all; nSamps = 100; xs = linspace( 0, 1, nSamps ); deltaX = xs(2)-xs(1); f0 = zeros( [ 1, nSamps ] ); nIters = 3; fnm1 = f0; fh=figure; colors='rbk'; for ii=1:nIters, % compute the integral of fnm1.^2: % intTerm = zeros( [ 1, nSamps ] ); for si=1:nSamps, intTerm(si) = trapz( fnm1(1:si).^2 ); end fn = xs/8 + deltaX*intTerm; figure(fh); hold on; plot( xs, fn, [ '-o', colors(mod(ii,length(colors))+1)] ); fnm1 = fn; end