From: Frank on 25 Mar 2010 09:56 Hi all! I need your help. I would like to create a code that allows me to fit a vector of data with a custom fit function (let's say a lorentzian curve to make an example). In that case my fitting parameters would be the position, the height and the half-width of the peak. How may I write such a function in order to fit my vector of data? I would also like to put some constranits on the values for the different parameters, like you can do in the graphical fitting toolbox, where you can specify e.g. the maximum linewidth for the peak and so on. Any help would be very appreciated! Thanks in advance Frank
From: James Allison on 25 Mar 2010 15:04 Perhaps lsqcurvefit would work for you. It allows bounds on function parameters. -James Frank wrote: > Hi all! > > I need your help. I would like to create a code that allows me to fit a > vector of data with a custom fit function (let's say a lorentzian curve > to make an example). In that case my fitting parameters would be the > position, the height and the half-width of the peak. > > How may I write such a function in order to fit my vector of data? I > would also like to put some constranits on the values for the different > parameters, like you can do in the graphical fitting toolbox, where you > can specify e.g. the maximum linewidth for the peak and so on. > > Any help would be very appreciated! > > Thanks in advance > > Frank
From: Frederic Moisy on 26 Mar 2010 08:07 Dear Frank, Try Ezyfit: http://www.mathworks.com/matlabcentral/fileexchange/10176-ezyfit-2-30 examples to fit gaussians can be find here: http://www.mathworks.com/matlabcentral/fx_files/10176/3/content/ezyfit/demo/html/efdemo.html (Unfortunately constrained fits are not available yet in this toolbox) F. "Frank " <francesco.manni01(a)fastwebnet.it> wrote in message <hofq1k$ss6$1(a)fred.mathworks.com>... > Hi all! > > I need your help. I would like to create a code that allows me to fit a vector of data with a custom fit function (let's say a lorentzian curve to make an example). In that case my fitting parameters would be the position, the height and the half-width of the peak. > > How may I write such a function in order to fit my vector of data? I would also like to put some constranits on the values for the different parameters, like you can do in the graphical fitting toolbox, where you can specify e.g. the maximum linewidth for the peak and so on. > > Any help would be very appreciated! > > Thanks in advance > > Frank
|
Pages: 1 Prev: many subplot, one tile , one colorbar Next: Find mean in a subsequence |