Code covered by the BSD License  

Highlights from
Chebfun V4

image thumbnail

Chebfun V4



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

function pass = sumcos20x

% Tests a couple of simple integrals, real and complex.
% (A Level 0 chebtest)
% Toby Driscoll and Rodrigo Platte.

tol = chebfunpref('eps');

f = chebfun('cos(20*x)');
pass = abs(sum(f)-sin(20)/10) < 1.5e-15*(tol/eps);

pass(2) = abs(sum(f*1i)-1i*sin(20)/10) < 1.5e-15*(tol/eps);

Contact us