fast reading of structured text data with matlab

In the following I present a solution to read data from a textfile which has the number of x-values (columns) in the first line, the number of y-values (rows) in the second line and in all following lines the matrix with size x times y. The principle reading of the data is achieved by the following code % open file display(['reading ' FILENAME]); fid = fopen(FILENAME, 'r'); fseek(fid, 0,...