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_ll2xy.m
    path of file: ./repos/matlab_owc/lib/m_map1.4
    
    the code of the file until where you have to start completion: function [X,Y,I]=m_ll2xy(varargin);
% M_LL2XY Converts long,lat to X,Y coordinates using the current projection
%         [X,Y]=m_ll2xy(LONGITUDE,LATITUDE);
%
%         Extra properties can be added after the latitude variable:
%          ...,'clip', ( 'on' | 'off' | 'patch'  | 'point' )
%         where normal clipping sets out-of-range values to NaN, and patch
%         clipping sets out-of-range values to border values (useful for
%         drawing patches). A border point is interpolated for line
%         segments crossing the border; line segments are assumed for
%         one-dimensional input arrays and for the columns of 2-dimensional
%         arrays. The interpolation can be disabled using the 'point'
%         option (i.e. data is composed of discrete unrelated points).
%
%         [X,Y,I]=m_ll2xy(...) returns an index to tell you which
%         points have been modified (I=1).

% 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.

% 6/Nov/00 - eliminate returned stuff if ';' neglected (thx to D Byrne)

global MAP_PROJECTION MAP_COORDS



if nargin==0 | isstr(varargin{1}),
  disp(' Usage');
  disp(' [X,Y]=m_ll2xy(LONGITUDES,LATITUDES <,''clip'',( ''on''|''off''|''patch'' | ''point'' ) >)');
else
  if strcmp(MAP_COORDS.name,MAP_PROJECTION.coordsystem.name),

    
function [X,Y,I]=m_ll2xy(varargin);
% M_LL2XY Converts long,lat to X,Y coordinates using the current projection
%         [X,Y]=m_ll2xy(LONGITUDE,LATITUDE);
%
%         Extra properties can be added after the latitude variable:
%          ...,'clip', ( 'on' | 'off' | 'patch'  | 'point' )
%         where normal clipping sets out-of-range values to NaN, and patch
%         clipping sets out-of-range values to border values (useful for
%         drawing patches). A border point is interpolated for line
%         segments crossing the border; line segments are assumed for
%         one-dimensional input arrays and for the columns of 2-dimensional
%         arrays. The interpolation can be disabled using the 'point'
%         option (i.e. data is composed of discrete unrelated points).
%
%         [X,Y,I]=m_ll2xy(...) returns an index to tell you which
%         points have been modified (I=1).

% 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.

% 6/Nov/00 - eliminate returned stuff if ';' neglected (thx to D Byrne)

global MAP_PROJECTION MAP_COORDS



if nargin==0 | isstr(varargin{1}),
  disp(' Usage');
  disp(' [X,Y]=m_ll2xy(LONGITUDES,LATITUDES <,''clip'',( ''on''|''off''|''patch'' | ''point'' ) >)');
else
  if strcmp(MAP_COORDS.name,MAP_PROJECTION.coordsystem.name),
     % Sneaky way of making default clipping on (sneaky 'cause only the 4th
     % input parameter is checked for the clipping property)
     [X,Y,I]=feval(MAP_PROJECTION.routine,'ll2xy',varargin{:},'clip','on');
  elseif strcmp(MAP_COORDS.name,'geographic'),
     [LONG,LAT]=mc_coords('geo2mag',varargin{1:2});
     args={varargin{3:end