\section{FOR For Loop}

\subsection{Usage}

The \verb|for| loop executes a set of statements with an 
index variable looping through each element in a vector.
The syntax of a \verb|for| loop is one of the following:
\begin{verbatim}
  for (variable=expression)
     statements
  end
\end{verbatim}
Alternately, the parenthesis can be eliminated
\begin{verbatim}
  for variable=expression
     statements
  end
\end{verbatim}
or alternately, the index variable can be pre-initialized
with the vector of values it is going to take:
\begin{verbatim}
  for variable
     statements
  end
\end{verbatim}
The third form is essentially equivalent to \verb|for variable=variable|,
where \verb|variable| is both the index variable and the set of values
over which the for loop executes.  See the examples section for
an example of this form of the \verb|for| loop.
\subsection{Examples}

Here we write \verb|for| loops to add all the integers from
\verb|1| to \verb|100|.  We will use all three forms of the \verb|for|
statement.
\begin{verbatim}
--> accum = 0;
--> for (i=1:100); accum = accum + i; end
--> accum

ans = 

 5050 


\end{verbatim}
The second form is functionally the same, without the
extra parenthesis
\begin{verbatim}
--> accum = 0;
--> for i=1:100; accum = accum + i; end
--> accum

ans = 

 5050 


\end{verbatim}
In the third example, we pre-initialize the loop variable
with the values it is to take
\begin{verbatim}

\end{verbatim}
