How to write data to a binary file?

조회 수: 17 (최근 30일)
LINGJUN KONG
LINGJUN KONG 2017년 7월 21일
답변: Navaneetha C M 2018년 1월 18일
I have a array data with 60,000*784*double. and I want to save them into a file by binary.
file=fopen('myfilelocation\data.bin','w');
fwrite(file,data,'double');
fclose(file);
the file was created and the size of the file is also 376,320,000 bytes. which means there are 60,000*784*8 bytes data in the file.
but when I open the file by other software, the content is all Null.
what's the reason? is that because of my data is too large?
  댓글 수: 1
James Tursa
James Tursa 2017년 7월 21일
편집: James Tursa 2017년 7월 21일
What do you get when you read it back into MATLAB? What about opening the file in a binary editor to see what is there?

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

답변 (1개)

Navaneetha C M
Navaneetha C M 2018년 1월 18일
The content of the file may not be parsed correctly by other software. You can use 'fread' function to read the contents of the file.

카테고리

Help CenterFile Exchange에서 文本文件에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!