image thumbnail
from Diffusive filling-in by Massimiliano Versace
The package contains a MATLAB implementation of diffusive filing-in model.

filling1D2N(q,u)
function y = filling1D2N(q,u)
    pass = 1;
    size = length(q);
    [t, Y] = ode15s(@FF,0:1:10000, reshape(q',size,1),[], q, u);
    y = Y(end,:)';

    function dy = FF(t, Y, x, p)
        pass= pass+1;
        D=0.0001;
        i = 2:size-1;
        s = q;
        y = Y';
        DY(size)=0;
        s(i)    = (y(i-1)-y(i)).*p(i,1)' + (y(i+1)-y(i)).*p(i,2)';
        s(1)    = (y(2)-y(1)).*p(1,2)'; %- y(1);
        s(size) = (y(size-1)-y(size)).*p(size,1)'; %- y(size);
        DY(:)   = -D*y(:) + sigmoid(x(:)) + s(:);
        dy = reshape(DY',size,1);
    end
end

Contact us at files@mathworks.com