| I use 'octave' to produce 16-bit binary values on one machine and use
| another machine to process those binary values. The binary format is
| both convenient and fast.
| Unfortunately, the "endianess" of the two machines is different.
| Of course, I have written a small program (using the common swab()
| library function) in C to perform what some call the needed "sex change".
| Question: how can I do this solely within (e.g., without needing an
| additional program) 'octave'? If I can find a way, this will save one
| step in my work.
Yes, Octave 2.x can swap the bytes for you when it reads the data.
Look at the documentation for the ARCH parameter for fopen, fread, and
fwrite. For example,
f = fopen ("foo", "r", "ieee-le");
opens the file `foo' for reading assuming the data format is little
endian with IEEE floating point, independent of the byte order of the
machine on which Octave is running.
The fread and fwrite functions also include an ARCH parameter that
allows you to override the default format specified when the file was