\section{VARARGIN Variable Input Arguments}

\subsection{Usage}

FreeMat functions can take a variable number of input arguments
by setting the last argument in the argument list to \verb|varargin|.
This special keyword indicates that all arguments to the
function (beyond the last non-\verb|varargin| keyword) are assigned
to a cell array named \verb|varargin| available to the function.
Variable argument functions are usually used when writing 
driver functions, i.e., functions that need to pass arguments
to another function.  The general syntax for a function that
takes a variable number of arguments is
\begin{verbatim}
  function [out_1,...,out_M] = fname(in_1,..,in_M,varargin)
\end{verbatim}
Inside the function body, \verb|varargin| collects the arguments 
to \verb|fname| that are not assigned to the \verb|in_k|.
\subsection{Example}

Here is a simple wrapper to \verb|feval| that demonstrates the
use of variable arguments functions.
\begin{verbatim}
    wrapcall.m
function wrapcall(fname,varargin)
  feval(fname,varargin{:});
\end{verbatim}
Now we show a call of the \verb|wrapcall| function with a number
of arguments
\begin{verbatim}
--> wrapcall('printf','%f...%f\n',pi,e)
3.141593...2.718282

\end{verbatim}
A more serious driver routine could, for example, optimize
a one dimensional function that takes a number of auxilliary
parameters that are passed through \verb|varargin|.
