Mercurial > hg > octave-nkf
diff scripts/polynomial/polyfit.m @ 7547:40ca9fb9a314
polyfit.m: Fixed tests.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Tue, 04 Mar 2008 14:02:53 -0500 |
parents | 83cce070104f |
children | 6f2d95255911 |
line wrap: on
line diff
--- a/scripts/polynomial/polyfit.m +++ b/scripts/polynomial/polyfit.m @@ -140,8 +140,7 @@ %! 315600.7143, 315602.9508, 315605.1765 ]; %! [p1, s1] = polyfit (x, y, 10); %! [p2, s2, mu] = polyfit (x, y, 10); -%! assert (s1.normr, 0.11264, 0.1) -%! assert (s2.normr < s1.normr) +%! assert (2*s2.normr < s1.normr) %!test %! x = 1:4; @@ -160,7 +159,7 @@ %! assert (p, pn, s.normr) %! assert (s.yf, y, s.normr) %! assert (mu, [mean(x), std(x)]) -%! assert (s.normr/s2.normr < 1e-9) +%! assert (s.normr/s2.normr < sqrt(eps)) %!test %! x = [1, 2, 3; 4, 5, 6];