MATLAB: How to read tabular data from *.DAT files into MATLAB

reading *.dat files into matlab

Dear all,
just tried to read a *.dat file into MATLAB. Loading the file worked out quite fine.
A=importdata('PIOMAS.vol.daily.1979.2013.Current.v2.dat');
A.data;
However, the resulting data looks strange (binary issue?).
2.0130 0.1490 0.0193
2.0130 0.1500 0.0192
2.0130 0.1510 0.0191
How it should look like
Year #day Vol
1979 1 26.405
1979 2 26.496
1979 3 26.582
1979 4 26.672
1979 5 26.770
1979 6 26.867
1979 7 26.940
1979 8 27.013
1979 9 27.095
1979 10 27.185
Maybe somebody knows how to do the trick. Best regards, Fernandes

Best Answer

You can use the “Import Tool” app or the “readtable” function to accomplish this.
Right click on the CSV file and select the “Import Tool”, which will help you through the import process. The Import Tool helps you import the data interactively.
Or use the “readtable” function which imports the data as a table:
T = readtable('myCSVfile.csv');
For more information on using “Import Tool” see:
For more information on using “readtable” see: