Main Content

HDF4 Files

Hierarchical Data Format, Version 4

Hierarchical Data Format, Version 4 (HDF4) is a library and multi-object file format for storing and managing data between machines. You can interact with HDF4 files in two ways:

  • The MATLAB® high-level HDF4 functions provide a simplified programmatic interface for reading data from HDF4 files. You can also use the imread and imwrite functions to read and write image data in HDF4 files.

  • The MATLAB low-level HDF4 functions provide finer control over the reading and writing process of HDF4 files by providing access to more than 100 functions in the HDF4 and HDF-EOS2 C libraries. To export non-image data to an HDF4 file, you must use the low-level functions.

    To use the MATLAB low-level HDF4 and HDF-EOS2 functions, you must be familiar with HDF4 and HDF-EOS2 C API programming concepts, described at

MATLAB uses HDF4 C library version 4.2.16-2 and HDF-EOS2 C library version 3.


expand all

View or Read HDF4 Files

hdfinfoInformation about HDF4 or HDF-EOS2 file
hdfreadRead data from HDF4 or HDF-EOS2 file

Read or Write Image Data in HDF4 Files

imreadRead image from graphics file
imwriteWrite image to graphics file

HDF4 SD and HDF-EOS GD and SW Namespaces access to HDF4 multifile scientific datasets (SD) access to HDF-EOS grid data access to HDF-EOS swath files

Gateway Functions to HDF4 Interfaces

hdfanGateway to HDF multifile annotation (AN) interface
hdfdf24Gateway to HDF 24-bit raster image (DF24) interface
hdfdfr8Gateway to HDF 8-bit raster image (DFR8) interface
hdfhGateway to HDF H interface
hdfhdGateway to HDF HD interface
hdfheGateway to HDF HE interface
hdfhxGateway to HDF external data (HX) interface
hdfmlUtilities for working with MATLAB HDF gateway functions
hdfptGateway to HDF-EOS Point interface
hdfvGateway to HDF Vgroup (V) interface
hdfvfGateway to VF functions in HDF Vdata interface
hdfvhGateway to VH functions in HDF Vdata interface
hdfvsGateway to VS functions in HDF Vdata interface


Related Information