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 dimension ID


dimid = netcdf.inqDimID(ncid,dimname)


dimid = netcdf.inqDimID(ncid,dimname) returns dimid, the identifier of the dimension specified by the character vector dimname. You can use the netcdf.inqDim function to retrieve the dimension name. ncid is a netCDF file identifier returned by netcdf.create or

This function corresponds to the nc_inq_dimid 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 example netCDF file included with MATLAB®,

% Open netCDF example file.
ncid ='','NC_NOWRITE');

% Get name and length of first dimension
[dimname, dimlen] = netcdf.inqDim(ncid,0);

% Retrieve identifier of dimension.
dimid = netcdf.inqDimID(ncid,dimname)

dimid =

Was this topic helpful?