5.6. Low-Level Input–Output Functions

There are a number of low-level file input–output functions in MATLAB which are based on the input–output functions of ANSI Standard C Library. The functions are generally categorized as

These are listed in Table 5.2.

Table 5.2. Low-Level File Input–Output Functions
Type of FunctionFunction NameDescription
File opening and closing functionsfopenOpen a file for read or write operations
 fcloseClose one or more opened files
Formatted input–output functionsfscanfRead formatted data from file
 fprintfWrite formatted data to file
 fgetlReturn next line of file as string without line terminator
 fgetsReturn next line of file ...

Get MATLAB® and Its Applications in Engineering: [Based on MATLAB 7.5 (R2007b)] now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.