I'm trying to pull data from a file using fscanf. The data file is formatted as you see in the fscanf below, and has 20 rows. I'm only getting 1 row's worth of data stored into A. I thought fscanf was supposed to read till the end of the file but it seems to only be reading the one line. Is there a way to correct it so it stores the data from all 20 rows?
fid = fopen('myfile.dat');fgetl(fid); fgetl(fid);A = fscanf(fid,'%f %f %f %f %*s %*s');B = reshape(A,4,20)'
Best Answer