help
fseek
fseek
Set file position indicator
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.
例如:
fid=fopen('idl2.txt','r+');
fseek(fid, 4, 'bof');
fwrite(fid, num2str(20));
fclose(fid);