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

GenerateShiftedCaspBar.m
i = COCE.PopulationSize(2)/2 - COCE.InternalArea(2)/2;
for j=i +1:i+COCE.InternalArea(2) % from the beginning of signal til the end
    jj = j; %save current index
   if ( j >= i+COCE.InternalArea(2)/2) %if current index is greater or equal the middle
     jj=j+1; %get to the next one
   end
   COCE.Data(:,j)=COCE.CaskContrast/(jj-i-COCE.InternalArea(2)/2) + COCE.InternalValue; %compute signa as signal + casp/(distance from center)
end;

Contact us at files@mathworks.com