| MATLAB Function Reference | ![]() |
Syntax
status = fseek(fid,offset,origin)
Description
status = fseek(fid,offset,origin)
repositions the file position indicator in the file with the given fid to the byte with the specified offset relative to origin.
Arguments
fid An integer file identifier obtained from fopen.
offsetA value that is interpreted as follows:
offset > 0Move position indicator
offset bytes toward the end of the file.offset = 0Do not change position.
offset < 0Move position indicator
offset bytes toward the beginning of the file.originA string whose legal values are:
'bof'-
1: Beginning of file.'cof'0: Current position in file.'eof'1: End of file.statusA returned value that is 0 if the fseek operation is successful and -1 if it fails. If an error occurs, use the function ferror to get more information.
See Also
| fscanf (serial) | ftell | ![]() |