Watch this Author's files
this is a great to code for the detection of a peak and its width.
Contact us at files@mathworks.com