필터 지우기
필터 지우기

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 (최근 30일)
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?

답변 (2개)

madhan ravi
madhan ravi 2018년 10월 17일
A=load('myfile.dat')
  댓글 수: 3
Ahmed Ibrahim
Ahmed Ibrahim 2018년 10월 17일
When I tried to upload, 'can't upload this file ,file format is unsupported' appears

댓글을 달려면 로그인하십시오.


Jan
Jan 2018년 10월 17일
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
Jan
Jan 2018년 10월 17일
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);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by