Last change
on this file since 4 was
4,
checked in by zhangj, 10 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
343 bytes
|
Line | |
---|
1 | function pass = interp1test |
---|
2 | |
---|
3 | % Nick Trefethen March 2009 |
---|
4 | |
---|
5 | d = domain(-2,1.5); |
---|
6 | ff = @(x) 1./(1+25*x.^2); |
---|
7 | x = linspace(-2,1.5,11); |
---|
8 | f = chebfun(ff,d); |
---|
9 | p = interp1(x,ff(x),d); |
---|
10 | pass1 = (abs(min(p)-(-2.439))<0.01); |
---|
11 | |
---|
12 | x = chebfun('x'); |
---|
13 | f = max(0,1-2*abs(x-.2)); |
---|
14 | xk = [0 .5 1]; |
---|
15 | p = interp1(xk,f); |
---|
16 | pass2 = (abs(p(-1)-0.4)<0.01); |
---|
17 | |
---|
18 | pass = pass1 && pass2; |
---|
Note: See
TracBrowser
for help on using the repository browser.