READBIN("file", "type",
[[endian], [cols], [skip], [maxrows]]) Returns an array
containing the binary data in file.
WRITEBIN("file", "type", endian, [M]) writes an
array of scalars to the binary data
file named file. This function can be used either on the right or the
left side of the definition operator.
When used on the right, you must supply the argument M, the name of the
matrix to write to the file. In this case, the function returns the contents
of the matrix. When used on the left, do not supply the argument M, but
instead place it on the right-hand side of the definition. See the QuickSheet
Example.
type is a string that specifies
the data format used in the file. READBIN supports the following data types:
byte - 8-bit unsigned integer.
double - 64-bit floating point number.
float - 32-bit floating point number.
int16 - signed 16-bit integer.
int32 - signed 32-bit integer.
uint16 - unsigned 16-bit integer.
uint32 - unsigned 32-bit integer.
endian (optional for READBIN) indicates whether the data in the file
is big-endian (high byte first) or little-endian (low byte first). Big-endian
is represented by a 1, while little-endian is represented by a 0. If no value
is specified, endian is assumed to be 0.
cols (optional) is the positive integer number of columns per row
in the input file. Default is 1.
skip (optional) is the non-negative integer number of bytes at the
beginning of the file to ignore before reading in data. Default is 0.
maxrows (optional) is the non-negative integer maximum number of rows
of data to be read from the data file. Default is 0 (no limit).
Note:
If you are not
sure whether your data is written in big-endian (the Macintosh standard)
or little-endian (the IBM-PC standard) format, please consult the system
documentation for your data source before relying upon the accuracy of
any result from READBIN or WRITEBIN.