Code covered by the BSD License  

Highlights from
Interactive Peak Fitter, version 2.2

image thumbnail
from Interactive Peak Fitter, version 2.2 by Tom O'Haver
A peak fitting program for time-series signals.

exp(-(log(x/pos)/(0.01.*wid)) .^2);
function g = lognormal(x,pos,wid)
% lognormal function.  pos=position; wid=half-width (both scalar)
% lognormal(x,pos,wid), where x may be scalar, vector, or matrix
% pos=position; wid=half-width (both scalar)
% T. C. O'Haver, 1991  
g = exp(-(log(x/pos)/(0.01.*wid)) .^2);

Contact us at files@mathworks.com