Skip to Main Content Skip to Search
Product Documentation

netcdf.inqAttID - Return ID of netCDF attribute

Syntax

attnum = netcdf.inqAttID(ncid,varid,attname)

Description

attnum = netcdf.inqAttID(ncid,varid,attname) retrieves attnum, the identifier of the attribute specified by the text string attname.

varid specifies the variable the attribute is associated with.

ncid is a netCDF file identifier returned by netcdf.create or netcdf.open.

This function corresponds to the nc_inq_attid function in the netCDF library C API. To use this function, you should be familiar with the netCDF programming paradigm. See netcdf for more information.

Examples

This example opens the netCDF example file included with MATLAB, example.nc.

% Open the netCDF example file.
ncid = netcdf.open('example.nc','NC_NOWRITE');

% Get the identifier of a variable in the file.
varid = netcdf.inqVarID(ncid,'avagadros_number');

% Retrieve the identifier of the attribute associated with the variable.
attid = netcdf.inqAttID(ncid,varid,'description');

See Also

netcdf.inqAtt | netcdf.inqAttName

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS