MATLAB: How to read file using textscan

textscan

I have a file with 4 row:
SiteNo time mintemperature maxtemperature
The time have already change into matlab format time. How can I read the file using textscan?

Best Answer

You could try:
filename = 'myFile.txt'; % example
fileID = fopen(filename);
C = textscan(fileID,'%d %s %.2f %.2f'); % SiteNo(integer), time(string), maxtemp and mintemp(float with 2 decimal),
fclose(fileID);
Related Question