h5readatt
Read attribute from HDF5 file
Description
Examples
Read Group Attributes
Read the attributeattr2
from the root group of the HDF5 fileexample.h5
.
val = h5readatt('example.h5','/','attr2')
val =2x2 int32 matrix0 2 1 3
Read Dataset Attributes
Read the attributeunits
from the datasetlon
in the HDF5 fileexample.h5
.
val = h5readatt('example.h5','/g4/lon','units')
val = 'degrees_east'
Input Arguments
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 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 name in Example: Example: |
||||||||
Remote Location |
If the file is stored at a remote location, then
Based on your remote location,
For more information, seeWork with Remote Data. Example: |
loc
—Location in file
character vector|string scalar
Location in the file, specified as a character vector or string scalar containing the full path of an existing group or dataset to which the attribute belongs. To read an attribute from the root group of the file, specify'/'
as the location.
attr
—Attribute name
character vector|string scalar
Attribute name, specified as a character vector or string scalar containing the name of an attribute belonging to a group or dataset.
版本历史
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
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)