You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: nc_drename.m
    path of file: ./repos/tracacode/1911-COAWST/script/mfiles/rutgers/netcdf
    
    the code of the file until where you have to start completion: function [status]=nc_drename(ncfile, Dname_old, Dname_new)

%
% NC_DRENAME:  Changes the name of a dimension in a NetCDF file
%
% status = nc_drename(ncfile, Dname_old, Dname_new)
%
% This function renames request
    
function status = nc_drename_matlab(ncfile, Dname_old, Dname_new, Info)

%
% NC_DRENAME_MATLAB:  Changes the name of a dimension in a NetCDF file
%
% status = nc_drename_matlab(ncfile, Dname_old, Dname_new, Info)
%
% This function renames requested dimension in a NetCDF file using the
% native Matlab interface.
%
% On Input:
%
%    ncfile       NetCDF file name   (string)
%
%    Dname_old    Old dimension name (string)
%
%    Dname_new    New dimension name (string)
%
%    Info         NetCDF information structure (struct array)
%
% On Output:
%
%    status       Error flag
%

% Initialize.

status = 0;

% Make sure that the new variable name does not exist in the NetCDF
% file.

if (any(strcmp({Info.Dimensions.Name}, Dname_new)))
  nc_inq(ncfile, true);
  disp(' ');
  error(['NC_DRENAME_MATLAB: new name already exist: ', Dname_new]);
end