attvalue = ncreadatt(filename, location, attname)
| Parameter | Description |
|---|---|
| filename | Path of the netCDF data source. |
| location | Variable name, or '/' for a global attribute. |
| attname | Attribute name. |
| Parameter | Description |
|---|---|
| attvalue | Return value described by the syntax shown above. |
ncreadatt reads metadata stored as netCDF attributes.
Use this function for high-level attribute access when variable names are known.
filename = [tempdir(), 'help_ncreadatt.nc'];
nccreate(filename, 'temperature', 'Dimensions', {'x', 2});
ncwriteatt(filename, 'temperature', 'units', 'degree');
units = ncreadatt(filename, 'temperature', 'units')
| Version | Description |
|---|---|
| 2.0.0 | initial version |