\section{SPRINTF Formated String Output Function (C-Style)}

\subsection{Usage}

Prints values to a string.  The general syntax for its use is
\begin{verbatim}
  y = sprintf(format,a1,a2,...).
\end{verbatim}
Here \verb|format| is the format string, which is a string that
controls the format of the output.  The values of the variables
\verb|a_i| are substituted into the output as required.  It is
an error if there are not enough variables to satisfy the format
string.  Note that this \verb|sprintf| command is not vectorized!  Each
variable must be a scalar.  The returned value \verb|y| contains the
string that would normally have been printed. For
more details on the format string, see \verb|printf|.  
\subsection{Examples}

Here is an example of a loop that generates a sequence of files based on
a template name, and stores them in a cell array.
\begin{verbatim}
--> l = {}; for i = 1:5; s = sprintf('file_%d.dat',i); l(i) = {s}; end;
--> l

ans = 

 ['file_1.dat']   ['file_2.dat']   ['file_3.dat']   ['file_4.dat']   ['file_5.dat']   


\end{verbatim}
