Code covered by the BSD License
by Chebfun Team
30 Apr 2009
(Updated 05 Apr 2012)
Numerical computation with functions instead of numbers.
This file was selected as MATLAB Central Pick of the Week
function pass = unboundednorms
% Tests norm for unbounded domains and subtraction of chebfuns.
% Sheehan Olver, November 2009.
tol = 100*chebfunpref('eps');
r = @(v) v(2:length(v));
f = chebfun('sech(x)',[0,inf]);
f2 = chebfun(chebpolyval(r(chebpoly(f))),[0,inf]);
f3 = f - f2;
pass(1) = norm(f)-norm(f2) < tol;
pass(2) = norm(f3.vals) < tol;
pass(3) = norm(f3) < tol;
pass(4) = norm(f3,inf) < tol;