23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7 Working with Scientific Data Formats<br />

Using the <strong>MATLAB</strong> Low-Level HDF5 Functions<br />

<strong>MATLAB</strong> provides direct access to the over 200 functions in the HDF5 library<br />

by creating <strong>MATLAB</strong> functions that correspond to the functions in the HDF5<br />

library. In this way, you can access the features of the HDF5 library from<br />

<strong>MATLAB</strong>, such as reading and writing complex data types and using the<br />

HDF5 subsetting capabilities.<br />

The HDF5 library organizes the library functions into groups, called<br />

interfaces. For example, all the routines related to working with files, such<br />

as opening and closing, are in the H5F interface, where F stands for file.<br />

<strong>MATLAB</strong> organizes the low-level HDF5 functions into classes that correspond<br />

to each HDF5 interface. For example, the <strong>MATLAB</strong> functions that correspond<br />

to the HDF5 fileinterface(H5F)areinthe@H5Fclassdirectory. Fora<br />

complete list of the HDF5 interfaces and the corresponding <strong>MATLAB</strong> class<br />

directories, see hdf5.<br />

The following sections provide more details about how to use the <strong>MATLAB</strong><br />

HDF5 low-level functions. Topics covered include:<br />

• “Mapping HDF5 Function Syntax to <strong>MATLAB</strong> Function Syntax” on page<br />

7-26<br />

• “Mapping BetweenHDF5DataTypesand<strong>MATLAB</strong>DataTypes”onpage<br />

7-29<br />

• “Example: Using the <strong>MATLAB</strong> HDF5 Low-level Functions” on page 7-30<br />

Note This section does not attempt to describe all features of the HDF5<br />

library or explain basic HDF5 programming concepts. To use the <strong>MATLAB</strong><br />

HDF5 low-level functions effectively, you must refer to the official HDF5<br />

documentation available at the HDF Web site (http://www.hdfgroup.org).<br />

Mapping HDF5 Function Syntax to <strong>MATLAB</strong> Function Syntax<br />

In most cases, the syntax of the <strong>MATLAB</strong> low-level HDF5 functions is<br />

identical to the syntax of the corresponding HDF5 library functions. For<br />

example, the following is the function signature of the H5Fopen function in<br />

the HDF5 library. In the HDF5 function signatures, hid_t and herr_t are<br />

7-26

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!