feof
Checks end of file.
📝Syntax
status = feof(fid)
📥Input Arguments
Parameter Description
fid a file descriptor
📤Output Arguments
Parameter Description
status an integer value: 1 if file is closed or 0 if not.
📄Description

feof checks if end of file has been reached.

💡Examples
fid = fopen([nelsonroot(), '/etc/startup.m'], 'rt');
feof(fid)
while ~feof(fid)
  tline = fgetl(fid);
  disp(tline);
end
feof(fid)
fclose(fid);
🔗See Also
fopenfgetl
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub