MATLAB Function Reference Previous page   Next Page
hdf5read

Read data from an HDF5 file

Syntax

Description

data = hdf5read(filename,datasetname) reads all the data in the data set datasetname that is stored in the HDF5 file filename and returns it in the variable data. To determine the names of data sets in an HDF5 file, use the hdf5info function.

The return value, data, is a multidimensional array. hdf5read maps HDF5 data types to native MATLAB data types, whenever possible. If it cannot represent the data using MATLAB data types, hdf5read uses one of the HDF5 data type objects. For example, if an HDF5 file contains a data set made up of an enumerated data type, hdf5read uses the hdf5.h5enum object to represent the data in the MATLAB workspace. The hdf5.h5enum object has data members that store the enumerations (names), their corresponding values, and the enumerated data. For more information about the HDF5 data type objects, see the hdf5 reference page.

attr = hdf5read(filename,attributename) reads all the metadata in the attribute attributename, stored in the HDF5 file filename, and returns it in the variable attr. To determine the names of attributes in an HDF5 file, use the hdf5info function.

[data,attr] = hdf5read(...,'ReadAttributes',BOOL) reads all the data as well as all of the associated attribute information contained within that data set. By default, BOOL is false.

data = hdf5read(hinfo) reads all of the data in the data set specified in the structure hinfo and returns it in the variable data. The hinfo structure is extracted from the output returned by hdf5info which specifies an HDF5 file and a specific data set.

Examples

Read a data set specified by an hinfo structure. Use hdf5info to get information about the HDF5 file.

Use hdf5read to read the data set specified by the info structure.

See Also

hdf5, hdf5info, hdf5write


Previous page  hdf5info hdf5write Next page

© 1994-2005 The MathWorks, Inc.