MATLAB: Can’ read low level file

filelow level filereading

% open the file for reading
fp = fopen(filename,'r');
% get off the header line
fgetl(fp);
%get data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% read the data to the specified size
size = fscanf(fp,'%d %f %f %f',[4 inf]);
Mt text file

Best Answer

You did not indicate the problem you encountered.
I suggest
fp = fopen(filename, 'r');
datacell = textscan(fp, '%d%f%f%f', 'HeaderLines', 1);
fclose(fp);
Then the month number will be datacell{1}, and the other columns will be datacell{2}, datacell{3}, datacell{4}
Related Question