Last change
on this file since 17 was
17,
checked in by zhangj, 10 years ago
|
To have a stable version on the server.
|
-
Property svn:executable set to
*
|
File size:
504 bytes
|
Line | |
---|
1 | function pass = testpolyfit |
---|
2 | % Rodrigo Platte Jan 2009 |
---|
3 | % Tests the polyfit commmand |
---|
4 | |
---|
5 | tol = chebfunpref('eps'); |
---|
6 | |
---|
7 | x = chebfun('x',[-2 2]); |
---|
8 | g = sign(x); |
---|
9 | f0 = polyfit(g, 0); |
---|
10 | pass0 = norm(f0,inf) < tol; |
---|
11 | f1 = polyfit(g, 1); |
---|
12 | pass1 = norm(f1 - chebfun([-1.5 1.5],[-2 2]) ,inf) < 10*tol; |
---|
13 | f2 = polyfit(g, 2); |
---|
14 | pass2 = norm(f2 - chebfun([-1.5 1.5],[-2 2]) ,inf) < 10*tol; |
---|
15 | f3 = polyfit(g, 3); |
---|
16 | pass3 = norm(f3 - chebfun([-.625 -1.1328125 1.1328125 .625],[-2 2]) ,inf) < 10*tol; |
---|
17 | pass = pass0 && pass1 && pass2 && pass3; |
---|
Note: See
TracBrowser
for help on using the repository browser.