% % Written by: % -- % John L. Weatherwax 2009-04-21 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- addpath('../../BookCode'); close all; clc; clear; % Problem EPage 81; Example EPage 66 % approx = fgauss( 'c_4_p_6_fn', 1, 10, 16 ) truth = 3 + 4 % 1, 4, 9 are squares; 2=1+1, 5=1+4, 10=1+9, 8=4+4 are sum of squares approx = fgauss( 'c_4_p_6_fn', 1, 17, 16 ) truth = 4 + 6 % 1, 4, 9, 16 are squares; 2=1+1, 5=1+4, 10=1+9, 17=1+16, 8=4+4, 4+9=13 are sum of squares approx = fgauss( 'c_4_p_6_fn', 1, 30, 16 ) truth = 5 + 10 % 1, 4, 9, 16, 25 are squares; 2=1+1, 5=1+4, 10=1+9, 1+16=17, 1+25=26, 8=4+4, 4+9=13, 4+16=20, 4+25=29, 9+9=18, 9+16=25 (counted already) are sum of squares