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

orthosincos
function pass = orthosincos
% This test constructs a system of chebfuns and checks they have been
% constructed correctly by checking an orthogonality condition.
% TAD

S = []; C = [];
for n = 1:5
  S = [S chebfun(@(x) sin(n*x),[0 2*pi])];
  C = [C chebfun(@(x) cos(n*x),[0 2*pi])];
end
ip = S'*C;
pass = norm(ip) < 100*eps;

end

Contact us