Matlab version of FlocMod