\section{IF-ELSEIF-ELSE Conditional Statements}

\subsection{Usage}

The \verb|if| and \verb|else| statements form a control structure for
conditional execution.  The general syntax involves an \verb|if|
test, followed by zero or more \verb|elseif| clauses, and finally
an optional \verb|else| clause:
\begin{verbatim}
  if conditional_expression_1
    statements_1
  elseif conditional_expression_2
    statements_2
  elseif conditional_expresiion_3
    statements_3
  ...
  else
    statements_N
  end
\end{verbatim}
Note that a conditional expression is considered true if 
the real part of the result of the expression contains
any non-zero elements (this strange convention is adopted
for compatibility with MATLAB).
\subsection{Examples}

Here is an example of a function that uses an \verb|if| statement
\begin{verbatim}
    if_test.m
function c = if_test(a)
  if (a == 1)
     c = 'one';
  elseif (a==2)
     c = 'two';
  elseif (a==3)
     c = 'three';
  else
     c = 'something else';
  end
\end{verbatim}
Some examples of \verb|if_test| in action:
\begin{verbatim}
--> if_test(1)
ans = 
  <string>  - size: [1 3]
 one
--> if_test(2)
ans = 
  <string>  - size: [1 3]
 two
--> if_test(3)
ans = 
  <string>  - size: [1 5]
 three
--> if_test(pi)
ans = 
  <string>  - size: [1 14]
 something else

\end{verbatim}
