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:
497 bytes
|
Line | |
---|
1 | function pass = maxtest |
---|
2 | |
---|
3 | % Rodrigo Platte |
---|
4 | % This used to crash because of double roots in sign.m |
---|
5 | |
---|
6 | z = chebfun('x',[-1 1]); |
---|
7 | y=max(abs(z),1-z.^2); |
---|
8 | v=max(y,1); |
---|
9 | |
---|
10 | pass(1) = norm(v-1) == 0; |
---|
11 | |
---|
12 | % Toby Driscoll |
---|
13 | % Checking out syntax of various forms of the call. |
---|
14 | y = max([z -z 0.5],[],2); |
---|
15 | pass(2) = (sum(y)==1.25); |
---|
16 | |
---|
17 | tol = chebfunpref('eps'); |
---|
18 | y = max([sin(2*z) cos(z)]); |
---|
19 | pass(3) = (sum(y)-2) < 10*tol; |
---|
20 | |
---|
21 | y = max(z.'); |
---|
22 | pass(4) = (y==1); |
---|
23 | |
---|
24 | y = max([z.'; -z.'; 0.5]); |
---|
25 | pass(5) = (sum(y)==1.25); |
---|
26 | |
---|
27 | pass = all(pass); |
---|
Note: See
TracBrowser
for help on using the repository browser.