Code covered by the BSD License  

Highlights from
Statistical Learning Toolbox

from Statistical Learning Toolbox by Dahua Lin
Functions for statistical learning, pattern recognition and computer vision, covering many topics.

Description of slevalfunctor
Home > sltoolbox > utils > slevalfunctor.m

slevalfunctor

PURPOSE ^

SLEVALFUNCTOR Evaluates a functor

SYNOPSIS ^

function varargout = slevalfunctor(functor, varargin)

DESCRIPTION ^

SLEVALFUNCTOR Evaluates a functor

 $ Syntax $
   - [O1, O2, ...] = slevalfunctor(functor, I1, I2, ...)

 $ Description $
   - [O1, O2, ...] = slevalfunctor(functor, I1, I2, ...) evaluates 
     the functor. Here, a functor refers to a function that can be
     invokable with parameters. A functor is typically used in a 
     framework function that need to invoke other functions with
     both the variables generated inside the framework and the
     variables offered from external environment. 
     If there is no external parameters, the functor can be
     given in the form of a function name, function handle or
     inline object; if there are external parameters the functor
     can be given in form of a cell array with the first cell being
     the callable function while the other cells containing the
     external parameters.

 $ Remarks $
   - For an empty functor, it simply does nothing and returns.

 $ History $
   - Created by Dahua Lin, on Aug 30, 2006

CROSS-REFERENCE INFORMATION ^

This function calls:
This function is called by:
  • slkmeansex SLKMEANSEX Performs Generalized K-means
  • slvote SLVOTE Builds histogram by voting (or fuzzy voting)
  • slnngraph SLNNGRAPH Constructs a nearest neighborhood based graph
  • slpwgraph SLVALGRAPH Constructs a graph by computing values between nodes pairwisely
  • slpwmetricgraph SLPWMETRICGRAPH Constructs a graph based on pairwise metrics
  • sliterproc SLITERPROC Runs a general iterative process
  • slproglearn SLPROGLEARN Performs Progressive Learning from sample source
  • slreevallearn SLREEVALLEARN Performs an iterative learning based on re-evaluation
  • slfmm SLFMM Learns a Finite Mixture Model (FMM)

SOURCE CODE ^

0001 function varargout = slevalfunctor(functor, varargin)
0002 %SLEVALFUNCTOR Evaluates a functor
0003 %
0004 % $ Syntax $
0005 %   - [O1, O2, ...] = slevalfunctor(functor, I1, I2, ...)
0006 %
0007 % $ Description $
0008 %   - [O1, O2, ...] = slevalfunctor(functor, I1, I2, ...) evaluates
0009 %     the functor. Here, a functor refers to a function that can be
0010 %     invokable with parameters. A functor is typically used in a
0011 %     framework function that need to invoke other functions with
0012 %     both the variables generated inside the framework and the
0013 %     variables offered from external environment.
0014 %     If there is no external parameters, the functor can be
0015 %     given in the form of a function name, function handle or
0016 %     inline object; if there are external parameters the functor
0017 %     can be given in form of a cell array with the first cell being
0018 %     the callable function while the other cells containing the
0019 %     external parameters.
0020 %
0021 % $ Remarks $
0022 %   - For an empty functor, it simply does nothing and returns.
0023 %
0024 % $ History $
0025 %   - Created by Dahua Lin, on Aug 30, 2006
0026 %
0027 
0028 if isempty(functor)
0029     return;
0030 end
0031 
0032 if iscell(functor)
0033     func = functor{1};
0034     if length(functor) > 1
0035         params = functor(2:end);
0036     else
0037         params = {};
0038     end
0039 else
0040     func = functor;
0041     params = {};
0042 end
0043 
0044 if isempty(func)
0045     return;
0046 end
0047 
0048 if nargout == 0
0049     feval(func, varargin{:}, params{:});
0050 else
0051     varargout = cell(1, nargout);
0052     [varargout{:}] = feval(func, varargin{:}, params{:});
0053 end
0054     
0055

Generated on Wed 20-Sep-2006 12:43:11 by m2html © 2003

Contact us at files@mathworks.com