Code covered by the BSD License  

Highlights from
Chebfun V4

image thumbnail

Chebfun V4

by

 

30 Apr 2009 (Updated )

Numerical computation with functions instead of numbers.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

unboundednorms
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;


Contact us