Write to an open file with fprintf . The only difference between fprintf and sprintf is the file identifier, fid, is used. Read one line of text from an open file with fgetl . The text line is stored as a character string in the variable line . Read columns of data from an open file with fscanf .
Single quotes enclose the format string.
If A has 10 rows and 2 columns, the 10 elements in column 1 are printed before the elements in column 2 are printed. Thus, each column of A will have only 2 values. If A has 10 rows and 2 columns, the 10 elements in column 1 are printed before the elements in column 2 are printed. Thus, each column of A will have only 2 values. This is typically used to read the header lines from the top of a data file.