data = h5read(filename,ds,start,count)
reads a subset of data from the dataset beginning at the location specified in
start. The count argument specifies the number of
elements to read along each dimension.
data = h5read(filename,ds,start,count,stride)
returns a subset of data with the interval between the indices of each dimension of the
dataset specified by stride.
Start reading from the location in startLoc and read variable data at intervals specified in stride. A value of 1 in stride accesses adjacent values in the corresponding dimension, whereas a value of 2 accesses every other value in the corresponding dimension, and so on.
filename — File name character vector | string scalar
File name, specified as a character vector or string scalar containing the name of
an existing HDF5 file.
Depending on the location of your file, filename can take on one
of these forms.
Location
Form
Current folder
Specify the name of the file in
filename.
Example:'myFile.h5'
Other folders
If the file is not in the current folder or in a folder on the
MATLAB® path, then specify the full or relative path name in
filename.
Example:'C:\myFolder\myFile.h5'
Example:'myFolder\myFile.h5'
Remote Location
If the file is stored at a remote location, then
filename must contain the full path of the file
specified as a uniform resource locator (URL) of the
form:
scheme_name://path_to_file/my_file.ext
Based on your remote location,
scheme_name can be one of the values in this
table.
ds — Dataset name character vector | string scalar
Dataset name, specified as a character vector or string scalar containing the name
of the dataset in the HDF5 file. An HDF5 dataset is a multidimensional array of data
elements, together with supporting metadata.
Starting location, specified as a numeric vector of positive integers. For an
N-dimensional dataset, start is a vector of
length N containing 1-based indices. The elements of
start correspond, in order, to the variable dimensions.
If you do not specify start, then the h5read
function starts reading the dataset from the first index along each dimension.
count — Number of elements vector of Inf's (default) | numeric vector
Number of elements to read, specified as a numeric vector of positive integers. For
an N-dimensional dataset, count is a vector of
length N, specifying the number of elements to read along each
dimension. The elements of count correspond, in order, to the
variable dimensions. If any element of count is
Inf, then h5read reads until the end of the
corresponding dimension.
If you do not specify count, then the h5read
function reads data until the end of each dimension.
stride — Spacing between indices vector of ones (default) | numeric vector
Space between the indices along each dimension of the dataset, specified as a
numeric vector of integers. For an N-dimensional variable in the
dataset, stride is a vector of length N. The
elements of the stride vector correspond, in order, to the variable
dimensions. A value of 1 accesses adjacent values of the variable in
the corresponding dimension. Whereas, a value of 2 accesses every
other value of the variable in the corresponding dimension, and so on.
If you do not specify stride, then the h5read
function reads the data with a default spacing of 1 along each
dimension.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.