Home > Scripts > Models > Factory > nlorz.m

iFit/nlorz

PURPOSE ^

y = nlorz(p, x, [y]) : multiple Lorentzians

SYNOPSIS ^

function y=nlorz(varargin)

DESCRIPTION ^

 y = nlorz(p, x, [y]) : multiple Lorentzians

   iFunc/nlorz multiple Lorentzian fitting function
     y = sum p(i)*exp(-0.5*((x-p(i+1))/p(i+2)).^2) + p(end);

   This expression assumes that the Amplitudes are independent from the Widths.

 MODEL CREATION

 You may build a model using any of:
   nlorz('defaults')       builds a 2 Lorentzians model
   nlorz(n)                builds an n Lorentzians model
   nlorz and nlorz('gui')  shows a Dialogue to enter the number of Lorentzians.
   nlorz([ ... ])          use a 3n+1 values parameters for n Lorentzians

 Reference: http://en.wikipedia.org/wiki/Lorenztian_function

 MODEL EVALUATION

 input:  p: multiple Lorentzian model parameters (double)
            p = [ Amplitude1 Centre1 HalfWidth1 ... BackGround ]
          or 'guess'
         x: axis (double)
         y: when values are given and p='guess', a guess of the parameters is performed (double)
 output: y: model value
 ex:     y=nlorz([1 0 1 0.5 2 0.5 0], -10:10); or plot(nlorz(3))

 Version: Nov. 26, 2018
 See also iFunc, iFunc/fits, iFunc/plot, ngauss
 (c) E.Farhi, ILL. License: EUPL.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Mon 26-Nov-2018 15:08:42 by m2html © 2005. iFit (c) E.Farhi/ILL EUPL 1.1