28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

'eof' 1: End of file<br />

status A returned value that is 0 if the fseek operation is successful and<br />

-1 if it fails. If an error occurs, use the function ferror to get<br />

more information.<br />

Examples This example opens the file test1.dat, seeks to the 20th byte, reads fifty 32-bit<br />

unsigned integers into variable A, and closes the file. It then opens a second file,<br />

test2.dat, seeks to the end-of-file position, appends the data in A to the end of<br />

this file, and closes the file.<br />

fid = fopen('test1.dat', 'r');<br />

fseek(fid, 19, 'bof');<br />

A = fread(fid, 50, 'uint32');<br />

fclose(fid);<br />

fid = fopen('test2.dat', 'r+');<br />

fseek(fid, 0, 'eof');<br />

fwrite(fid, A, 'uint32');<br />

fclose(fid);<br />

See Also fopen, fclose, ferror, fprintf, fread, fscanf, ftell, fwrite<br />

fseek<br />

2-905

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!