| MATLAB Function Reference | Search  Help Desk |
| ferror | See Also |
Query MATLAB about errors in file input or output
message = ferror(fid) message = ferror(fid,'clear') [message,errnum] = ferror(...)
message = ferror(fid)
returns the error message message. Argument fid is a file identifier associated with an open file (See fopen for a complete description).
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 may contain information about the nature of the error. If the message is not helpful, consult the C runtime library manual for your host operating system for further details.
fclose Close one or more open files
fopen Open a file or obtain information about open files
fprintf Write formatted data to file
fread Read binary data from file
fscanf Read formatted data from file
fseek Set file position indicator
ftell Get file position indicator
fwrite Write binary data from a MATLAB matrix to a file