View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Toolbox diffc

3.5 | 4 ratings Rate this file 21 Downloads (last 30 days) File Size: 1.18 MB File ID: #5103 Version: 1.2
image thumbnail

Toolbox diffc


Gabriel Peyre (view profile)


04 Jun 2004 (Updated )

A toolbox to perform differential calculus on a matrix.

| Watch this File

File Information

See HTML help file for information about the content (see below in 'Published HTML files').

Copyright (c) 2008 Gabriel Peyre

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
16 Dec 2016 tianyu fu

@Will Morrison, I think the codes you compute the divergence and the curl are wrong. The correct code is [curlz,cav] = curl(x,y,a(:,:,2),a(:,:,1)); and
d = divergence(x,y,b(:,:,2),b(:,:,1));

Comment only
05 Jun 2015 Will Morrison

Looks like the Hodge Helmholtz decomposition does not work for all vector fields. for example, the curl-free and divergence-free parts in the below example do not have zero curl and divergence.

options.bound = 'per';
mesh_size = 0.1;
xp = -2.05:mesh_size:2.05;
yp = -2.05:mesh_size:2.05;
f = x.^2 - y.^2;
fn = sqrt(fx.^2 +fy.^2);
[a,b] = compute_hodge_decompositon(cat(3,fx./fn,fy./fn),options);
[curlz,cav] = curl(x,y,a(:,:,1),a(:,:,2));
surf(x, y, curlz)
d = divergence(x,y,b(:,:,1),b(:,:,2));
surf(x, y, d)

27 Apr 2012 Maider Marin

I try several test files and none of them work, I try test_structure_tensor.m and two other more and I could not make them work. Functions lack documentation within themself. I have to go to a help page to understant the input and outbuts of the functions. I also have the same error that Walid report and many others. If you have the time please correct them this is really a good effort that is not visible since there are some small errors.

28 Nov 2009 Sheraz Khan

28 Mar 2008 Walid Kamoun

I AM trying to run it but it keeps on outputting "Undefined function or method 'getoptions' for input arguments of type 'struct'."

Comment only
25 May 2006 Truc Phan

it's really helpful. We do not need to again and again calculate those time-consuming functions

13 Jul 2004

Added non centred differences.

11 Aug 2004

Added quick gradient computation.

27 Apr 2007

GPL license.

21 Nov 2007

Fixed a few bugs.

01 Feb 2008

Added diagonalization of 3D tensors fields.

18 Aug 2008

Add html help files.

25 Jun 2009 1.1

BSD Licence

27 Jun 2009 1.2

Update of Licence

Contact us