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_check.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 I = nc_check(Info)

%
% NC_CHECK:  Checks NetCDF information structure for compliance
%
% I = nc_check(Iold)
%
% This function checks the information structure returned from calls to
% "nc_inq" or native "ncinfo" for compliance and changes new variable
% types and attributes. For example, it updates the "spherical" switch
% to integer and fixes the land/sea masking attributes for compliance.
%
% Recall that this information structure is very convenient to create
% new NetCDF files having the dimensions and variable schema of and
% old NetCDF file.
%
% On Input:
%
%    Info        NetCDF file information structure (struct array)
%
% On Ouput:
%
%    I           Updated NetCDF file information structure (struct array)
%

% svn $Id: nc_check.m 938 2019-01-28 06:35:10Z arango $
%=========================================================================%
%  Copyright (c) 2002-2019 The ROMS/TOMS Group                            %
%    Licensed under a MIT/X style license                                 %
%    See License_ROMS.txt                           Hernan G. Arango      %
%=========================================================================%

% Note: A easy way to delete all attributes for a variable is to set its
% ====  value to empty:
%
%      I.Variables(index).Attributes = []
%
% or overwrite with an Attribute substructure, A:
%
%      I.Variables(index).Attributes = A
%

% Initialize output structure with input structure.
  
I = Info;

%--------------------------------------------------------------------------
% Check spherical variable and change to integer.  Nowadays, we avoid
% using a character.
%--------------------------------------------------------------------------

index = strcmp({I.Variables.Name}, 'spherical');


    
function I = nc_check(Info)

%
% NC_CHECK:  Checks NetCDF information structure for compliance
%
% I = nc_check(Iold)
%
% This function checks the information structure returned from calls to
% "nc_inq" or native "ncinfo" for compliance and changes new variable
% types and attributes. For example, it updates the "spherical" switch
% to integer and fixes the land/sea masking attributes for compliance.
%
% Recall that this information structure is very convenient to create
% new NetCDF files having the dimensions and variable schema of and
% old NetCDF file.
%
% On Input:
%
%    Info        NetCDF file information structure (struct array)
%
% On Ouput:
%
%    I           Updated NetCDF file information structure (struct array)
%

% svn $Id: nc_check.m 938 2019-01-28 06:35:10Z arango $
%=========================================================================%
%  Copyright (c) 2002-2019 The ROMS/TOMS Group                            %
%    Licensed under a MIT/X style license                                 %
%    See License_ROMS.txt                           Hernan G. Arango      %
%=========================================================================%

% Note: A easy way to delete all attributes for a variable is to set its
% ====  value to empty:
%
%      I.Variables(index).Attributes = []
%
% or overwrite with an Attribute substructure, A:
%
%      I.Variables(index).Attributes = A
%

% Initialize output structure with input structure.
  
I = Info;

%--------------------------------------------------------------------------
% Check spherical variable and change to integer.  Nowadays, we avoid
% using a character.
%--------------------------------------------------------------------------

index = strcmp({I.Variables.Name}, 'spherical');

if (any(index) && strcmpi(I.Variables(index).Datatype, 'char')),

  I.Variables(index).Datatype   = 'int32';
  I.Variables(index).ncType     = nc_constant('nc_int');

  A(1).Name  = 'long_name';
  A(1).Value = 'grid type logical switch';

  A(2).Name  = 'flag_values';
  A(2).Value = [int32(0) int32(1)];
  
  A(3).Name  = 'flag_meanings';
  A(3).Value = 'Cartesian spherical';
  
  I.Variables(index).Attributes = A;
end