Code covered by the BSD License  

Highlights from
Toolbox Fast Marching

image thumbnail

Toolbox Fast Marching

by

 

24 Oct 2004 (Updated )

A toolbox for the computation of the Fast Marching algorithm in 2D and 3D.

num2string_fixeddigit.m
function str = num2string_fixeddigit(num, d)

% num2string_fixeddigit - convert a number to string with a fixed number of digits
%
%   str = num2string_fixeddigit(num, d);
%
%   examples for d=3: 12.3->'012', 99->'099', 999->'999', 1200->'1200' (overflow).
%
%   Copyright (c) 2004 Gabriel Peyr


num = round(num);

str = num2str(num);

for i=1:d-1
    if num<10^i
        str = ['0' str];
    end
end

Contact us