Chebfun is an open-source package for computing
with functions to about 15-digit accuracy. Most Chebfun commands
are overloads of familiar MATLAB commands — for
example sum(f) computes an integral,
roots(f) finds zeros, and u =
L\f solves a differential equation.

% Define two functions
f = chebfun(@(x) sin(x.^2)+sin(x).^2, [0,10]);
g = chebfun(@(x) exp(-(x-5).^2/10), [0,10]);
% Compute their intersections
rr = roots(f - g);
% Plot the functions
plot([f g]), hold on
% Plot the intersections
plot(rr, f(rr), 'o')

% Airy operator
op = @(x,u) 0.01*diff(u,2) - x.*u;
% Create a chebop
L = chebop(op, [-5,5]);
% Apply boundary conditions
L.bc = 'dirichlet';
% Solve the differential equation
u = L \ 1;
plot(u)

% The Dixon-Szego function
f = @(x,y) (4-2.1*x.^2+ x.^4/3).*x.^2 ...
+ x.*y + 4*(y.^2-1).*y.^2;
% Create a chebfun2
F = chebfun2(f, [-2,2,-1.25,1.25]);
% Find the minimum and mark it
[minf,minx] = min2(F);
contour(F,30), hold on
plot(minx(1),minx(2),'.w')