| MATLAB® | ![]() |
message = ferror(fid)
message = ferror(fid, 'clear')
[message,errnum] = ferror(...)
message = ferror(fid) returns the error string message. Argument fid is a file identifier associated with an open file (see fopen for a complete description of fid).
message = ferror(fid, 'clear') clears the error indicator for the specified file.
[message,errnum] = ferror(...) returns the error status number errnum of the most recent file I/O operation associated with the specified file.
If the most recent I/O operation performed on the specified file was successful, the value of message is empty and ferror returns an errnum value of 0.
A nonzero errnum indicates that an error occurred in the most recent file I/O operation. The value of message is a string that can contain information about the nature of the error. If the message is not helpful, consult the C run-time library manual for your host operating system for further details.
fclose, fopen, feof, fseek, ftell, fscanf, fread, fprintf, fwrite
![]() | feof | feval | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |