Home > Scripts > Models > Factory > ifitmakefunc.m

iFit/ifitmakefunc

PURPOSE ^

f = ifitmakefunc(fun, descr, pars, expr, guess, constraint) : build a fit function/model

SYNOPSIS ^

function f = ifitmakefunc(varargin)

DESCRIPTION ^

 f = ifitmakefunc(fun, descr, pars, expr, guess, constraint) : build a fit function/model

   iFit/ifitmakefunc fit function/model builder.
     when only the first argument is specified as an expression (using p and x,y,z,t)
       a model is built from the expression analysis.
         ifitmakefunc(EXPR)
     when only the first argument is specified as a structure, it should define fields
       fun.Name:        the function name
       fun.Description: the description of the function
       fun.Parameters:  the parameter names as words separated with spaces
       fun.Guess:       the default parameters, or 'automatic'
       fun.Expression:  the expression of the function value
       fun.Constraint:  the expression executed before the function evaluation
     when input parameters are missing, a dialog pops-up to request the information
       all arguments are optional (can be left empty), except the expression
     when exactly 5 arguments are given, the dialogue does not show up, and a the 
       model is retunred directly.
     The list of all available function can be obtained with the 'fits(iFunc)' 

 WARNING: the 1D and 2D cases work fine, but higher dimensions (using z,t...) are NOT validated.

 input:  FUN:     function name or expression (single word or expression or structure or iFunc model)
         DESCR:   description of the function (string)
         PARS:    name of parameters, as a single string of words 'a b c ...'
         EXPR:    expression of the function value, using 'p' vector as parameter values
         GUESS:   default parameter values (guess, optional, leave empty for automatic guess)
         CONSTRAINT: expression to execute before the function evaluation
           which may contain any parameter constraints such as 'p(1)=p(5)'

 output: f: new model object
 
 Version: Nov. 26, 2018
 See also iData, gauss, iFunc
 (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