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_test.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 nc_test(ncfile, Interface, Lplot)

%
% NC_TEST:  Test reading/writing NetCDF data with various iterfaces
%
% nc_test(ncfile, interface, Lplot)
%
% This function creates a NetCDF using data from the peaks(40) function.
% Several datatype variables are created original double precision data
% and packed into byte (int8), short (int16), integer (int32), and single
% precission.  It is used to test the reading/writing NetCDF interface
% to Matlab. It computes and reports the processing and truncation RMSE.
%
% On Input:
%
%    ncfile      NetCDF file name to create (string)
%
%    Interface   NetCDF interface for Matlab (string):
%
%                  'native'     Native Matlab interface
%                  'mexnc'      MEXNC interface
%                  'roms'       ROMS 'nc_write' and 'nc_read' interface      
%                  'snctools'   SNCTOOLS inteface
%
%    Lplot       Switch to plot the data (default false, Optional)
%

% svn $Id: nc_test.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      %
%=========================================================================%

% Initialize.
  

    
function nc_test(ncfile, Interface, Lplot)

%
% NC_TEST:  Test reading/writing NetCDF data with various iterfaces
%
% nc_test(ncfile, interface, Lplot)
%
% This function creates a NetCDF using data from the peaks(40) function.
% Several datatype variables are created original double precision data
% and packed into byte (int8), short (int16), integer (int32), and single
% precission.  It is used to test the reading/writing NetCDF interface
% to Matlab. It computes and reports the processing and truncation RMSE.
%
% On Input:
%
%    ncfile      NetCDF file name to create (string)
%
%    Interface   NetCDF interface for Matlab (string):
%
%                  'native'     Native Matlab interface
%                  'mexnc'      MEXNC interface
%                  'roms'       ROMS 'nc_write' and 'nc_read' interface      
%                  'snctools'   SNCTOOLS inteface
%
%    Lplot       Switch to plot the data (default false, Optional)
%

% svn $Id: nc_test.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      %
%=========================================================================%

% Initialize.
  
if (nargin < 3),
  Lplot = false;
end

original = false;        % switch for SNCTOOLS: original 'nc_varput' does
                         % not work... This is a nasty bug!

%  Create NetCDF file.

mode = netcdf.getConstant('CLOBBER');
ncid = netcdf.create(ncfile,mode);

%  Clear and set persistent switch to process data in column-major order.

if (strncmpi(Interface, 'SNCTOOLS', 3)),
  if (ispref('SNCTOOLS','PRESERVE_FVD')),
    saved_preserve_fvd = getpref('SNCTOOLS','PRESERVE_FVD');
  else
    saved_preserve_fvd = false;             % default value in SNCTOOLS
  end