Code covered by the BSD License  

Highlights from
Toolbox Fast Marching

image thumbnail
from Toolbox Fast Marching by Gabriel Peyre
A toolbox for the computation of the Fast Marching algorithm in 2D and 3D.

nb_dims(x)
function d = nb_dims(x)

% nb_dims - debugged version of ndims.
%
%   d = nb_dims(x);
%
%   Copyright (c) 2004 Gabriel Peyr

if isempty(x)
    d = 0;
    return;
end

d = ndims(x);

if d==2 && (size(x,1)==1 || size(x,2)==1)
    d = 1;
end

Contact us at files@mathworks.com