|MATLAB Function Reference|
Read band interleaved data from a binary file
X = multibandread(filename, size, precision, offset, interleave,
reads multiband data from the binary file,
filename. This function defines band as the third dimension in a 3-D array, as shown in this figure.
You can use the parameters to
multibandread to specify many aspects of the read operation, such as which bands to read. See Parameters for more information.
If you only read one band, the return value,
X, is a 2-D array. If you read multiple bands,
X is 3-D. By default,
X is an array of type
double; however, you can use the
precision parameter to specify any other data type.
X = multibandread(...,subset1,subset2,subset3)
reads a subset of the data in the file. You can use up to three subsetting parameters to specify the data subset along row, column, and band dimensions. See Subsetting Parameters for more information.
This table describes the arguments accepted by
||A string containing the name of the file to be read.
||A three-element vector of integers consisting of
||A string specifying the format of the data to be read, such as
Note: You can also use the
||A scalar specifying the zero-based location of the first data element in the file. This value represents the number of bytes from the beginning of the file to where the data begins.
||A string specifying the format in which the data is stored
For more information about these interleave methods, see the
||A string specifying the byte ordering (machine format) in which the data is stored, such as,
You can specify up to three subsetting parameters. Each subsetting parameter is a three-element cell array,
, index}, where
||A text string specifying the dimension to subset along. It can have any of these values:
||A text string specifying the subsetting method. It can have either of these values:
Read data from a multiband file into an 864-by-702-by-3
Read all rows and columns, but only bands 3, 4, and 6.
Read all bands and subset along the rows and columns.