Documentation

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.

netcdf.inq

Return information about netCDF file

Syntax

[ndims,nvars,ngatts,unlimdimid] = netcdf.inq(ncid)

Description

[ndims,nvars,ngatts,unlimdimid] = netcdf.inq(ncid) returns the number of dimensions, variables, and global attributes in a netCDF file. The function also returns the ID of the dimension defined with unlimited length, if one exists.

ncid is a netCDF file identifier returned by netcdf.create or netcdf.open. You can call netcdf.inq in either define mode or data mode.

This function corresponds to the nc_inq 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 example netCDF file included with MATLAB®, example.nc, and uses the netcdf.inq function to get information about the contents of the file.

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

% Get information about the contents of the file.
[numdims, numvars, numglobalatts, unlimdimID] = netcdf.inq(ncid)

numdims =

     4


numvars =

     4


numglobalatts =

     1


unlimdimID =

     3
Was this topic helpful?