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: m_elev.m
    path of file: ./repos/tracacode/1911-COAWST/script/mfiles/m_map
    
    the code of the file until where you have to start completion: function [values,longs,lats]=m_elev(varargin)
% M_ELEV Contour elevation onto a map using a 1-degree database
%        M_ELEV contours elevations at 1000m intervals for the map.
%        M_ELEV(OPTN) where OPTN is one of the following strings lets
%        you draw a particular background:
%        OPTN: 'contour' -  contour lines are drawn.
%              'contourf' -  filled contours are drawn. 
%                               LEVELS are the levels used, and ARGS
%                               are optional patch arguments of line types, 
%                               colors, etc. 
%              'pcolor'    - pcolor call
%              'image'     - displays pixellated image
%              'shadedrelief' - shaded relief map.
%        M_ELEV(OPTN,args,...) lets you pass arguments to the OPTN call.
%
%        [CS,H]=M_ELEV(...) allows access to the return arguments of the
%        contour/contourf call.
%
%        [ELEV,LONG,LAT]=M_ELEV([LONG_MIN LONG_MAX LAT_MIN LAT_MAX])
%        extracts elevation data for the given lat/long limits (without plotting).
%
%        See also M_PROJ, M_GRID, M_COAST

% Rich Pawlowicz (rich@ocgy.ubc.ca) 2/Apr/1997
%
% This software is provided "as is" without warranty of any kind. But
% it's mine, so you can't sell it.
%
% 20/5/97 - moved registration over by 1/2 degree (seems to fit better)
% 2/10/97 - a minor bug in the edge-handling for filled contours!
% 8/ 1/98 - better handling for options.
% 23/1/98 - redid everything to allow for raw bathymetry output option.
% 6/Nov/00 - eliminate returned stuff if ';' neglected (thx to D Byrne)
% 4/DEc/11 - isstr to ischar
% 30/Aug/13 - hack edge-handling in azimuthal projections that wrap
%             around.
% Mar/20/2019 - changed call sequence, other stuff for shaded relief.

global MAP_PROJECTION MAP_VAR_LIST 


% First case if we just want to extract dat, otherwise we are drawing.
if nargin==1 && ~ischar(varargin{1}) && length(varargin{1})==4
  draw_map=0;
else

    
function [values,longs,lats]=m_elev(varargin)
% M_ELEV Contour elevation onto a map using a 1-degree database
%        M_ELEV contours elevations at 1000m intervals for the map.
%        M_ELEV(OPTN) where OPTN is one of the following strings lets
%        you draw a particular background:
%        OPTN: 'contour' -  contour lines are drawn.
%              'contourf' -  filled contours are drawn. 
%                               LEVELS are the levels used, and ARGS
%                               are optional patch arguments of line types, 
%                               colors, etc. 
%              'pcolor'    - pcolor call
%              'image'     - displays pixellated image
%              'shadedrelief' - shaded relief map.
%        M_ELEV(OPTN,args,...) lets you pass arguments to the OPTN call.
%
%        [CS,H]=M_ELEV(...) allows access to the return arguments of the
%        contour/contourf call.
%
%        [ELEV,LONG,LAT]=M_ELEV([LONG_MIN LONG_MAX LAT_MIN LAT_MAX])
%        extracts elevation data for the given lat/long limits (without plotting).
%
%        See also M_PROJ, M_GRID, M_COAST

% Rich Pawlowicz (rich@ocgy.ubc.ca) 2/Apr/1997
%
% This software is provided "as is" without warranty of any kind. But
% it's mine, so you can't sell it.
%
% 20/5/97 - moved registration over by 1/2 degree (seems to fit better)
% 2/10/97 - a minor bug in the edge-handling for filled contours!
% 8/ 1/98 - better handling for options.
% 23/1/98 - redid everything to allow for raw bathymetry output option.
% 6/Nov/00 - eliminate returned stuff if ';' neglected (thx to D Byrne)
% 4/DEc/11 - isstr to ischar
% 30/Aug/13 - hack edge-handling in azimuthal projections that wrap
%             around.
% Mar/20/2019 - changed call sequence, other stuff for shaded relief.

global MAP_PROJECTION MAP_VAR_LIST 


% First case if we just want to extract dat, otherwise we are drawing.
if nargin==1 && ~ischar(varargin{1}) && length(varargin{1})==4
  draw_map=0;
else
  draw_map=1;
  optn='contour';
  levels=[-7000:1000:-1000 1000:1000:5000];
  
  if nargin>=1 && ischar(varargin{1})
     optn=varargin{1};
     varargin(1)=[];
  end