Code covered by the BSD License  

Highlights from
Toolbox image

from Toolbox image by Gabriel Peyre
A toolbox that contains image processing functions

test_periodic_laplacian.m
% test for laplacian resolution with periodic boundary conditions

% generate random function
name = 'regular3';
options.bound = 'per';
n = 128;
M = load_image(name, n, options);
M = 1+rescale(M);

[gx,gy] = grad(M,options);
d = div(gx,gy,options);
G = compute_periodic_poisson(d);

% should be zero
norm(G-M+mean(M(:)))

Contact us at files@mathworks.com