Home > Objects > @iFunc > feval.m

iFit/feval

PURPOSE ^

[signal, model, axes, name] = feval(model, parameters, x,y, ...) evaluate a function

SYNOPSIS ^

function [signal, model, ax, name] = feval(model, p, varargin)

DESCRIPTION ^

 [signal, model, axes, name] = feval(model, parameters, x,y, ...) evaluate a function

   @iFunc/feval applies the function 'model' using the specified parameters and axes
     and function parameters 'pars' with optional additional parameters.
     a fast notation is to pass arguments directly to the model:
       model(p, x,y,z,...)

   The parameters can be specified as a single vector, with one value per
   model Parameter, a structure with named Parameters, a cell with one entry
   per Parameter, a string which can be 
     'identify'  returns a string with the Model details
     'guess'     guess starting parameters
     'current'   use the current (last stored) parameter values, or guess
     'plot'      plot the model with default parameters and axes.

   Providing an empty parameter argument is similar to 'guess'.
   Providing a NaN parameter, or a vector containing NaN values, will guess
   missing parameters, using any optional 'signal' for the guess.
   Providing parameters as a structure or cell with vector values performs a scan
   along the vector values.

   The axes are given as vectors/matrices for the model evaluation. When given
   as NaN, the axis is not used and left as NaN.

   signal = feval(model, 'guess', x,y, ..., signal...)
     makes a quick parameter guess. This usually requires to specify the signal
     to guess from to be passed after the axes. The parameters are then in model.ParameterValues
     or returned instead of the signal when the model can not be updated.
   signal = feval(model, NaN, x,y, ..., signal...)
     same as above, but force to get the evaluated function value with
     guessed parameters.
   signal = feval(model, [ ... Nan ... ], x,y, ..., signal...)
     requires some of the initial parameters to be given, others as NaN's. These
     values are then replaced by guessed ones, and the model value is returned.
   signal = feval(model, parameters, x,y, ...)
     evaluates the model with given parameters and axes
   signal = model(p, iData_object)
     evaluates the model on the given iData object axes and return the values
   iData_object(model,p,...)
     evaluate the model and return an iData object

 input:  model: model function (iFunc, single or array)
         parameters: model parameters (vector, cell or vectors, structure, iData) or 'guess'
         x,y,..:  axes values to be used for the computation (vector,matrix,iData)
         ...: additional parameters may be passed, which are then forwarded to the model
 output: signal: result of the evaluation (vector/matrix/cell) or guessed parameters (vector)
         model:  return updated object with stored parameter values (iFunc)
         axes:   return the axes used for evaluation (cell of vector/matrix)
         name:   return model name (char)

 ex:     b=feval(gauss,[1 2 3 4]); feval(gauss*lorz, [1 2 3 4, 5 6 7 8]);
           feval(gauss,'guess', -5:5, -abs(-5:5))

 Version: Aug. 22, 2017
 See also iFunc, iFunc/fit, iFunc/plot

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Tue 22-Aug-2017 11:03:30 by m2html © 2005. iFit (c) E.Farhi/ILL EUPL 1.1