This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Close one or all open files


status = fclose(...)


fclose(fileID) closes an open file. fileID is an integer file identifier obtained from fopen.

fclose('all') closes all open files. Specify the literal all as a character vector or a string scalar.

status = fclose(...) returns a status of 0 when the close operation is successful. Otherwise, it returns -1.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced before R2006a

Was this topic helpful?