\section{FEOF End Of File Function}

\subsection{Usage}

Check to see if we are at the end of the file.  The usage is
\begin{verbatim}
  b = feof(handle)
\end{verbatim}
The \verb|handle| argument must be a valid and active file handle.  The
return is true (logical 1) if the current position is at the end of
the file, and false (logical 0) otherwise.  Note that simply reading
to the end of a file will not cause \verb|feof| to return \verb|true|.  
You must read past the end of the file (which will cause an error 
anyway).  See the example for more details.
\subsection{Example}

Here, we read to the end of the file to demonstrate how \verb|feof| works.
At first pass, we force a read of the contents of the file by specifying
\verb|inf| for the dimension of the array to read.  We then test the
end of file, and somewhat counter-intuitively, the answer is \verb|false|.
We then attempt to read past the end of the file, which causes an
error.  An \verb|feof| test now returns the expected value of \verb|true|.
\begin{verbatim}
--> fp = fopen('test.dat','rb');
--> x = fread(fp,[512,inf],'float');
--> feof(fp)

ans = 

 0 

--> x = fread(fp,[1,1],'float');
Error: Insufficient data remaining in file to fill out requested size
--> feof(fp)

ans = 

 1 


\end{verbatim}
