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: sw_g.m
    path of file: ./repos/matlab_owc/lib/seawater_330_its90
    
    the code of the file until where you have to start completion: 
function g = sw_g(LAT,z)

% SW_G       Gravitational acceleration
%===========================================================================
% SW_G   $Id: sw_g.m,v 1.1 2003/12/12 04:23:22 pen078 Exp $
%        Copyright (C) CSIRO, Phil Morgan 1993.
%
% USAGE:  g = sw_g(lat,z)
%
% DESCRIPTION:
%    Calculates acceleration due to gravity as function of latitude.
%
% INPUT:  (all must have same dimensions)
%   lat = Latitude in decimal degress north [-90..+90]
%   z   = height in metres (+ve above sea surface, -ve below)
%
% OUTPUT:
%  g    = gravity [m/s^2]
%
% AUTHOR:  Phil Morgan 93-04-20  (morgan@ml.csiro.au)
%
% DISCLAIMER:
%   This software is provided "as is" without warranty of any kind.
%   See the file sw_copy.m for conditions of use and licence.
%
% REFERENCES:
%   Unesco 1983. Algorithms for computation of fundamental properties of
%   seawater, 1983. _Unesco Tech. Pap. in Mar. Sci._, No. 44, 53 pp.
%
%   A.E. Gill 1982. p.597
%   "Atmosphere-Ocean Dynamics"
%   Academic Press: New York.  ISBN: 0-12-283522-0
%=========================================================================

% CALLER:  general purpose
% CALLEE:  none
    
function g = sw_g(LAT,z)

% SW_G       Gravitational acceleration
%===========================================================================
% SW_G   $Id: sw_g.m,v 1.1 2003/12/12 04:23:22 pen078 Exp $
%        Copyright (C) CSIRO, Phil Morgan 1993.
%
% USAGE:  g = sw_g(lat,z)
%
% DESCRIPTION:
%    Calculates acceleration due to gravity as function of latitude.
%
% INPUT:  (all must have same dimensions)
%   lat = Latitude in decimal degress north [-90..+90]
%   z   = height in metres (+ve above sea surface, -ve below)
%
% OUTPUT:
%  g    = gravity [m/s^2]
%
% AUTHOR:  Phil Morgan 93-04-20  (morgan@ml.csiro.au)
%
% DISCLAIMER:
%   This software is provided "as is" without warranty of any kind.
%   See the file sw_copy.m for conditions of use and licence.
%
% REFERENCES:
%   Unesco 1983. Algorithms for computation of fundamental properties of
%   seawater, 1983. _Unesco Tech. Pap. in Mar. Sci._, No. 44, 53 pp.
%
%   A.E. Gill 1982. p.597
%   "Atmosphere-Ocean Dynamics"
%   Academic Press: New York.  ISBN: 0-12-283522-0
%=========================================================================

% CALLER:  general purpose
% CALLEE:  none

%-------------
% CHECK INPUTS
%-------------
if ~(nargin==1 | nargin==2)
   error('sw_g.m:  Requires one or two input arguments')
end