Reading binary file with Octave
Posted
by
Anthony Blake
on Stack Overflow
See other posts from Stack Overflow
or by Anthony Blake
Published on 2011-11-25T01:41:53Z
Indexed on
2011/11/25
1:52 UTC
Read the original article
Hit count: 184
I'm trying to a binary file consisting of floats with Octave (on OS X), but I'm getting the following error:
octave-3.2.3:2> load Input.dat R -binary
error: load: failed to read matrix from file `Input.dat'
The file was written like so:
std::ofstream fout("Input.dat", std::ios::trunc | std::ios::binary);
fout.write(reinterpret_cast<char*>(Buf), N*sizeof(double));
fout.close();
Any idea what could be going wrong here?
© Stack Overflow or respective owner