% % Written by: % -- % John L. Weatherwax, Ph.D. 2002-11-05 % MIT Lincoln Laboratory % 244 Wood Street % Lexington, MA 02420-9176 USA % % email: weatherwax@ll.mit.edu % Voice: (781) 981-5370 Fax: (781) 981-0721 % % Please send comments and especially bug reports to the % above email address. % %----- ni = [ -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 ]; xi = (pi/4)*ni; g = zeros( size( ni ) ); % Initialize g; for i=1:10 g = g + (12*((-1)^(i+1))/(i^3))*sin(i*xi); end figure; hold on; plot( xi, g, '-or' ); plot( xi, pi^2*xi - xi.^3, '-og' );