Watch this Author's files
Small bug at line#73, should be: c=abs(copy(i,j)-mi-mu); instead of: c=abs(copy(i,j)-mu); % (mi missing)
Also, performance can be quite improved
Contact us at files@mathworks.com