Last change
on this file since 4 was
4,
checked in by zhangj, 11 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
590 bytes
|
Line | |
---|
1 | function pass = NaNandInf |
---|
2 | |
---|
3 | % Rodrigo Platte |
---|
4 | |
---|
5 | % If an evaluation returns NaN or Inf, the constructro should give an error |
---|
6 | % message! |
---|
7 | |
---|
8 | splitting off |
---|
9 | % NaN |
---|
10 | pass1 = false; |
---|
11 | try |
---|
12 | chebfun(@(x) x.^6.*sin(1./x.^2),[-1 1]); |
---|
13 | catch |
---|
14 | pass1 = true; |
---|
15 | end |
---|
16 | |
---|
17 | % Inf |
---|
18 | pass2 = false; |
---|
19 | try |
---|
20 | chebfun(@(x) log(x+1)); |
---|
21 | catch |
---|
22 | pass2 = true; |
---|
23 | end |
---|
24 | |
---|
25 | splitting on |
---|
26 | |
---|
27 | % NaN |
---|
28 | pass3 = false; |
---|
29 | try |
---|
30 | chebfun(@(x) x.^6.*sin(1./x.^2),[-1 1]); |
---|
31 | catch |
---|
32 | pass3 = true; |
---|
33 | end |
---|
34 | |
---|
35 | % Inf |
---|
36 | pass4 = false; |
---|
37 | try |
---|
38 | chebfun(@(x) log(x+1)); |
---|
39 | catch |
---|
40 | pass4 = true; |
---|
41 | end |
---|
42 | |
---|
43 | |
---|
44 | pass = pass1 && pass2 && pass3 && pass4; |
---|
45 | |
---|
46 | chebfunpref factory; |
---|
Note: See
TracBrowser
for help on using the repository browser.