fscanfMat — Reads a Matrix from a text file.
M=fscanfMat(filename); [M,text]=fscanfMat(filename);
a character string giving the name of the file to be scanned.
Output variable. A matrix of real numbers.
Output variable. A string matrix.
The fscanfMat
function is used to read a scalar matrix from a
text file. The first non-numeric lines of the file are returned
in text
if requested and
all the remaining lines must have the same number of columns (column
separator are assumed to be white spaces or tab characters). The
number of columns of the matrix will follow the number
of columns found in the file and the number of lines is fetched by
detecting eof in the input file. This function can be used to read
back numerical data saved with the fprintfMat
.