FUNCTION REFERENCE

feof

Test for the end of a file.

Test for the end of a file.

Syntax

tf = feof(fid)

The result is true once a read has reached the end of the file; fseek (even

one that fails) and frewind clear it. fgetl and fgets report the end as soon as they read the last line.

Example

fid = fopen('data.txt'); fgetl(fid); fgetl(fid); feof(fid)   % true

Differences from MATLAB: none known.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.