h5info
Information about HDF5 file
Syntax
Description
Examples
Information About Entire HDF5 File
Return information about the entire file 'example.h5
'.
info = h5info('example.h5')
info = struct with fields:
Filename: '/mathworks/devel/bat/filer/batfs2566-0/Bdoc24b.2725827/build/runnable/matlab/toolbox/matlab/demos/example.h5'
Name: '/'
Groups: [4x1 struct]
Datasets: []
Datatypes: []
Links: []
Attributes: [2x1 struct]
Information About Group
Return information about the group g4
.
info = h5info('example.h5','/g4')
info = struct with fields:
Filename: '/mathworks/devel/bat/filer/batfs2566-0/Bdoc24b.2725827/build/runnable/matlab/toolbox/matlab/demos/example.h5'
Name: '/g4'
Groups: []
Datasets: [4x1 struct]
Datatypes: []
Links: []
Attributes: []
Information About Specific Dataset
Return information about the dataset time
in the group g4
.
info = h5info('example.h5','/g4/time')
info = struct with fields:
Filename: '/mathworks/devel/bat/filer/batfs2566-0/Bdoc24b.2725827/build/runnable/matlab/toolbox/matlab/demos/example.h5'
Name: 'time'
Datatype: [1x1 struct]
Dataspace: [1x1 struct]
ChunkSize: 10
FillValue: 0
Filters: []
Attributes: [2x1 struct]
Input Arguments
filename
— Filename
string scalar | character vector
Filename of an existing HDF5 file, specified as a string scalar or character vector.
Depending on the location of your file, filename
can take one of
these forms.
Location | Form | ||||||||
---|---|---|---|---|---|---|---|---|---|
Current folder | Specify the name of the file in
Example:
| ||||||||
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 in
Example:
Example:
| ||||||||
Uniform resource locator (URL) (since R2024b) | If the file is located by an internet URL, then
Example:
| ||||||||
Remote location | If the file is stored at a remote location, then
Based on your remote location,
For more information, see Work with Remote Data. Example:
|
If your file consists of several physical files using the Family driver, specify
filename
using a format specifier. For example, to use the Family driver with the two filesfamily0.h5
andfamily1.h5
, specifyfilename
as"family%d.h5"
.If your file consists of several physical files using the Multi driver or the Split driver, specify
filename
as the leading prefix of the names of the physical files. For example, to use the Multi driver with the six filesmulti-b.h5
,multi-g.h5
,multi-l.h5
,multi-o.h5
,multi-r.h5
, andmulti-s.h5
, specifyfilename
as"multi"
.
loc
— Location in file
character vector | string scalar
Location in the file, specified as a character vector or string scalar containing
the file path of a group, dataset, or named datatype in the file. To return information
about the entire file, specify '/'
as the location.
Output Arguments
info
— File information
structure
File information returned as a structure. The structure has different fields
depending on the loc
argument points to a file or group, dataset, or
named datatype. The following tables list the fields that are present for each location
type.
Files and Groups
Field | Description |
---|---|
Name | Character vector specifying name of the group or dataset. If you specify only the HDF5 file name, the function will return information about the root group. |
Groups | Array of structures describing subgroups. |
Datasets | Array of structures describing datasets. |
Datatypes | Array of structures describing named datatypes. |
Links | Array of structures describing soft, external, user-defined, and certain hard links. |
Attributes | Array of structures describing group attributes. |
Datasets
Field | Description |
---|---|
Name | Character vector specifying the name of the dataset. |
Datatype | Structure describing the datatype. |
Dataspace | Structure describing the size of the dataset. |
ChunkSize | Dimensions of the dataset chunk size, if defined. |
FillValue | Fill value for missing data, if defined. |
Filter | Array of structures describing any defined filters, such as compression. |
Attributes | Array of structures describing dataset attributes. |
Named Datatypes
Field | Description |
---|---|
Name | Character vector specifying the name of the datatype object. |
Class | HDF5 class of the named datatype. |
Type | Character vector or structure further describing the datatype. |
Size | Size of the named datatype in bytes. |
Limitations
MATLAB does not support internet URLs that require authentication.
MATLAB Online™ supports internet URLs associated with Microsoft® OneDrive™ files and folders, while the installed version of MATLAB supports only local OneDrive files.
The
h5info
function output omits information for datasets and attributes that fail file integrity checks. (since R2024b)
Version History
Introduced in R2011aR2024b: Datasets and attributes that fail file integrity checks no longer supported (R2024b Update)
The h5info
function issues a warning for datasets and attributes
that fail file integrity checks and omits information about those datasets and attributes
from its output. Previously, this function did not issue a warning for such datasets or
attributes and included information about those datasets and attributes in its output. The
warning takes this
form:
Warning: Unable to read 'datasetName' from the file. A portion of the file may be corrupt.
R2024b: Read information about HDF5 files over HTTP and HTTPS
You can read information about HDF5 files stored in primary online sources by using the
h5info
function with an internet URL.
R2020b: Read information about HDF5 files at a remote location
You can read information about HDF5 files in remote locations, such as Amazon S3, Windows Azure Blob Storage, and HDFS.
R2020b: Read information about HDF5 files with Unicode names
You can read information about HDF5 files whose names are encoded as Unicode characters.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
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.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)