This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Return ID of netCDF attribute


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


attnum = netcdf.inqAttID(ncid,varid,attname) retrieves attnum, the identifier of the attribute indicated by attname. Specify attname as a character vector.

varid specifies the variable the attribute is associated with.

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

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.


This example opens the netCDF example file included with MATLAB®,

% Open the netCDF example file.
ncid ='','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');
Was this topic helpful?