Great Submission! One thing that isn't clear is your use of Corrective Factor SF. Is there a corresponding paper that you could refer me to? Moreover, something seems to be wrong with the last nested for loop. As of now, the line for i = 1:length(sf) is equivalent to the line i = length(sf), since you don't carry any history for utmp with the iterating index i.