fclose

Purpose

Close one or more open files.

Synopsis

status = fclose(fid)
status = fclose('all')

Description

fclose(fid) closes the specified file, if it is open, and returns 0 if successful and -1 if unsuccessful. fid is a file identifier associated with an open file. (See fopen for a complete description of fid.)

fclose('all') closes all open files, (except standard input, output, and error) and returns 0 if successful and -1 if unsuccessful.

See Also

ferror, fopen, fprintf, fread, fscanf, fseek, ftell, fwrite, sprintf, 
sscan

(c) Copyright 1994 by The MathWorks, Inc.