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 = breakpoints
% Check if splitting works, with or without breakpoints.
% Rodrigo Platte
f=chebfun(@(x) ceil(x-.1), [0 1 2]);
pass(1) = length(f) == 4;
pass(2) = length(f) == 3;
f1 = chebfun(@(x) ceil(x), -10:2); % Prescribed brkpoints
f2 = chebfun(@(x) ceil(x), [-10 2]);
pass(3) = isequal(f1,f2);