Filter löschen
Filter löschen

I have a *.dat file that contains a numerical results, and I want to plot these results using Matlab. how can I open this file in Matlab? and if I want to store it in matrix,what should I do? . The file contains approx. 1000 row by 2 or 3 columns

1 Ansicht (letzte 30 Tage)
I have a *.dat file that contains a numerical results, and I want to plot these results using Matlab. how can I open this file in Matlab? and if I want to store it in matrix,what should I do?

Antworten (2)

madhan ravi
madhan ravi am 17 Okt. 2018
A=load('myfile.dat')
  3 Kommentare
Ahmed Ibrahim
Ahmed Ibrahim am 17 Okt. 2018
When I tried to upload, 'can't upload this file ,file format is unsupported' appears

Melden Sie sich an, um zu kommentieren.


Jan
Jan am 17 Okt. 2018
It depends on how the data are store in the .dat file. There is no standard structure for this file extension, so it could be a binary or text file. So please post a small example of your file.
  3 Kommentare
Jan
Jan am 17 Okt. 2018
fid = fopen(FileName, 'r');
if fid == -1, error('Cannot open file: %s', FileName), end
fgetl(fid); % Skip first line
Data = fscanf(fid, '%g ', [3, inf]);
fclose(fid);

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Import and Export finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by