source: MML/trunk/machine/SOLEIL/common/toolbox/chebfun_v2_0501/chebfun/chebtests/maxtest.m @ 4

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