How can open and read .dat file?
조회 수: 793 (최근 30일)
이전 댓글 표시
A=[3 4 4 NaN NaN NaN NaN NaN;
36 46 4 4 1 3 NaN NaN;
24 32 3 3 1 3 2 3;
25 32 3 3 1 3 2 NaN];
I have stored this matrix as a .dat file using following code:
filename = sprintf('output.dat');
dlmwrite(filename, A, ' ' );
Now I want to open (fopen) this "output.dat" file in read mode and want to read data from this open file using fscanf. How can I do that?
any help would be greatly appreciated.
Thank you!
답변 (1개)
Walter Roberson
2020년 9월 8일
result = load('output.dat');
댓글 수: 4
Huy Le Van
2020년 11월 4일
편집: Rik
2020년 11월 4일
I can not read file.dat.
Do you replay follow email []@gamil.com
Walter Roberson
2020년 11월 4일
dat is not a fixed file format. It is used by many different programs for whatever data they have handy. You would need to know which program created the file to try to figure out what the file format is.
참고 항목
카테고리
Help Center 및 File Exchange에서 Low-Level File I/O에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!