\section{ERROR Causes an Error Condition Raised}

\subsection{Usage}

The \verb|error| function causes an error condition (exception
to be raised).  The general syntax for its use is
\begin{verbatim}
   error(s),
\end{verbatim}
where \verb|s| is the string message describing the error.  The
\verb|error| function is usually used in conjunction with \verb|try|
and \verb|catch| to provide error handling.  If the string \verb|s|,
then (to conform to the MATLAB API), \verb|error| does nothing.
\subsection{Example}

Here is a simple example of an \verb|error| being issued by a function
\verb|evenoddtest|:
\begin{verbatim}
    evenoddtest.m
function evenoddtest(n)
  if (n==0)
    error('zero is neither even nor odd');
  elseif (~isa(n,'int32'))
    error('expecting integer argument');
  end;
  if (n==int32(n/2)*2)
    printf('%d is even\n',n);
  else
    printf('%d is odd\n',n);
  end
\end{verbatim}
The normal command line prompt \verb|-->| simply prints the error
that occured.
\begin{verbatim}
--> evenoddtest(4)
4 is even
--> evenoddtest(5)
5 is odd
--> evenoddtest(0)
In base(base) on line 0
In simkeys(built in) on line 0
In Eval(evenoddtest(0)) on line 1
In evenoddtest(evenoddtest) on line 3
Error: zero is neither even nor odd
--> evenoddtest(pi)
In base(base) on line 0
In simkeys(built in) on line 0
In Eval(evenoddtest(pi)) on line 1
In evenoddtest(evenoddtest) on line 5
Error: expecting integer argument

\end{verbatim}
