Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

importing .dat binari file including dates and numbers

조회 수: 4 (최근 30일)
Leila Saberi
Leila Saberi 2017년 5월 19일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi,
I am trying to import a .dat file which I assume includes a column of dates and several columns of numbers. I am getting errors while trying fread: fid = fopen ('example.ec.dat', 'r') canopy_evaporation = fread (fid, inf, 'unit8');
fid =
-1
Error using fread Invalid file identifier. Use fopen to generate a valid file identifier.
Could you please let me know how I can import this? Unfortunately the file size is larger than 5Mb compressed, so I could not attach that here. Thanks

답변 (1개)

Shubham Srivastava
Shubham Srivastava 2017년 5월 22일
Hi Leila,
Please go through the following Stack Overflow discussion regarding invalid file identifiers in MATLAB:
As one of those discussion mentions if fopen is used without permission option, or if used 'r' (default) option, fopen will return -1, which is error. Trying using an option like 'w' or 'a' to resolve it.
Hope it helps.
Regards,
Shubham

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by