Reading binary file with Octave
- by Anthony Blake
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?