Skip to Main Content Skip to Search
Product Documentation

netcdf.inqVarIDs - IDs of all variables in group

Syntax

varids = netcdf.inqVarIDs(ncid)

Description

varids = netcdf.inqVarIDs(ncid) returns IDs of the all the variables in the group specified by ncid.

Input Arguments

ncid

Identifier of NetCDF file, returned by netcdf.create or netcdf.open, or of a NetCDF group, returned by netcdf.defGrp.

Output Arguments

varids

Array containing identifiers of variables in a NetCDF file or group.

Examples

This example opens the NetCDF sample file and gets the IDs of all the variables in a group.

 ncid = netcdf.open('example.nc','NOWRITE');
 gid = netcdf.inqNcid(ncid,'grid1');
 varids = netcdf.inqVarIDs(gid);
 netcdf.close(ncid);

References

This function corresponds to the nc_inq_varids function in the NetCDF library C API.

For copyright information, read the netcdfcopyright.txt and mexnccopyright.txt files.

See Also

netcdf | netcdf.inqDimIDs | netcdf.inqVarID

  


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