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.


Change name of netCDF dimension




netcdf.renameDim(ncid,dimid,newName) renames the dimension identified by the dimension identifier, dimid.

newName is a character string specifying the new name. ncid is a netCDF file identifier returned by netcdf.create or

This function corresponds to the nc_rename_dim 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 modifies a local copy of the example netCDF file included with MATLAB®,

% Open netCDF file.
ncid ='','NC_WRITE')

% Put file is define mode.

% Get the identifer of a dimension to rename.
dimid = netcdf.inqDimID(ncid,'x');

% Rename the dimension.

% Verify that the name changed.
data = netcdf.inqDim(ncid,dimid)

data =


See Also

Was this topic helpful?