How can I read a .DAT file into a variable?

11 次查看(过去 30 天)
Keith Grey
Keith Grey2020-5-19
评论: Walter Roberson ,2020-5-19
Currently, I collect data in .DAT format, use an older software package to convert it to .CSV, and read it into MATLAB using:
FILE = csvread('Data.csv', 1, 0, [1, 0, 401, 4]); % 400 rows of numerical data & 4 columns (no text)
I've tried reading in a .DAT file using an example I found in the MATLAB documentation:
csvwrite('csvlist.dat',m)
However, the results end up being a wild assortment of characters.
  4 个评论
Walter Roberson
Walter Roberson 2020-5-19
csvwrite('csvlist.dat',m)
That would not read a .dat file and write out a corresponding .csv file !
There is no standardized .dat format: '.dat' is used as a generic "data" indication, and can be in any format, including proprietary binary formats (and possibly even encrypted.)
If you know which device created the .dat file then we might be able to track down documentation as to the format of the file.

请先登录,再进行评论。

回答(0 个)

类别

Find more on Encryption / Cryptography in Help Center and File Exchange

产品


版本

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by