netcdf.inqDim - Return netCDF dimension name and length
Syntax
[dimname, dimlen] = netcdf.inqDim(ncid,dimid)
Description
[dimname, dimlen] = netcdf.inqDim(ncid,dimid) returns
the name, dimname, and length, dimlen,
of the dimension specified by dimid. If ndims is
the number of dimensions defined for a netCDF file, each dimension
has an ID between 0 and ndims-1. For example, the
dimension identifier of the first dimension is 0, the second dimension
is 1, and so on.
ncid is a netCDF file identifier returned
by netcdf.create or netcdf.open.
This function corresponds to the nc_inq_dim function
in the netCDF library C API. To use this function, you should be familiar
with the information about netCDF contained in the NetCDF
C Interface Guide for version 3.6.2.
Examples
The example opens the example netCDF file include with MATLAB, example.nc.
ncid = netcdf.open('example.nc','NC_NOWRITE');
% Get name and length of first dimension
[dimname, dimlen] = netcdf.inqDim(ncid,0)
dimname =
x
dimlen =
50
See Also
netcdf.inqDimID
 | netcdf.inqAttName | | netcdf.inqDimID |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit