Return information about NetCDF data source
finfo = ncinfo(source)
vinfo = ncinfo(source,varname)
ginfo = ncinfo(source,groupname)
finfo = ncinfo(source) returns information
in the structure finfo about the entire NetCDF
data source specified by source, where source can
be the name of a NetCDF file or the URL of an OPeNDAP NetCDF data
source.
vinfo = ncinfo(source,varname) returns
information in the structure vinfo about the variable varname in source.
ginfo = ncinfo(source,groupname) returns
information in the structure ginfo about the group groupname in source (only
NetCDF4 data sources).
Note
Use ncdisp for visual inspection of a NetCDF
source.
|
Character vector or string scalar specifying the name of a NetCDF file or the URL of an OPeNDAP NetCDF data source. |
|
Character vector or string scalar specifying the name of a variable in a NetCDF file or OPeNDAP data source. |
|
Character vector or string scalar specifying the name of a group in a NetCDF file or OPeNDAP data source. |
|
A structure with the following fields.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
A structure containing only the variable fields from
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
A structure containing only the group fields from
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Search for dimensions with names that start with the character x in
the file.
finfo = ncinfo('example.nc');
disp(finfo);
dimNames = {finfo.Dimensions.Name};
dimMatch = strncmpi(dimNames,'x',1);
disp(finfo.Dimensions(dimMatch));
Obtain the size of a variable and check if it has any unlimited dimensions.
vinfo = ncinfo('example.nc','peaks');
varSize = vinfo.Size;
disp(vinfo);
hasUnLimDim = any([vinfo.Dimensions.Unlimited]);Find all unlimited dimensions defined in a group.
ginfo = ncinfo('example.nc','/grid2/');
unlimDims = [ginfo.Dimensions.Unlimited];
disp(ginfo.Dimensions(unlimDims));