netcdf.inqAttID
netCDF 属性の ID を返します。
構文
attnum = netcdf.inqAttID(ncid,varid,attname)
説明
attnum = netcdf.inqAttID(ncid,varid,attname) は、attname が示す属性の識別子 attnum を取得します。attname は文字ベクトルまたは string スカラーとして指定します。
varid は属性が関連付けられている変数を指定します。
ncid は、関数 netcdf.create または関数 netcdf.open によって返される netCDF ファイル識別子です。
この関数は、NetCDF ライブラリ C API の関数 nc_inq_attid に相当します。この関数を使用するには、NetCDF プログラミング パラダイムに関する知識が必要です。
例
この例では、MATLAB® に含まれている netCDF サンプル ファイル 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');