Contents Previous Next Subchapters

Detecting End of File
Syntax eof(file_name)
See Also read , write , close

Returns true, if there are no characters past the current read location marker for the specified file and false otherwise, where file_name is a character row vector.

If the file temp.dat is located in the current working directory and contains
     1 0
     0 1
and you enter
     f = "temp.dat"
     while not eof(f) begin
          print read(f, "int")
O-Matrix will respond
     [ 0 , 1 ]
     [ 1 , 0 ]