Watch this Author's files
I have also noticed the error in the first derivative of the Gaussian at line 108.
For your second question, I think that a Gaussian smoothing helps as a preprocessing step to remove noise.
Contact us at files@mathworks.com