Code covered by the BSD License  

Highlights from
lorentzian fit

image thumbnail
from lorentzian fit by Yohanan Sivan
In the attached file example i use "nlinfit", which can fit any kind of function that you want. the

[y]=fun(v,x)
function [y]=fun(v,x)
y0=v(1);
A=v(2);
w=v(3);
x0=v(4);
y=y0+(2*A/pi).*(w./(4*(x-x0).^2+w.^2));


Contact us at files@mathworks.com