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: stretching.m
    path of file: ./repos/tracacode/1911-COAWST/script/mfiles/rutgers/utility
    
    the code of the file until where you have to start completion: function [s,C]=stretching(Vstretching, theta_s, theta_b, hc, N, kgrid,  ...
                          report)
%
% STRETCHING:  Compute ROMS vertical coordinate stretching function
%
% [s,C]=stretching(Vstretching, theta_s, theta_b, hc, N, kgrid, report)
%
% Given vertical terrain-following vertical stretching parameters, this
% routine computes the vertical stretching function use
    
function
%--------------------------------------------------------------------------

% Original vertical stretching function (Song and Haidvogel, 1994).

if (Vstretching == 1),

  ds=1.0/N;
  if (kgrid == 1),
    Nlev=Np;

    lev=0:N;
    s=(lev-N).*ds;
  else
    Nlev=N;
    lev=(1:N)-0.5;
    s=(lev-N).*ds;
  end
  if (theta_s > 0),
    Ptheta=sinh(theta_s.*s)./sinh(theta_s);
    Rtheta=tanh(theta_s.*(s+0.5))./(2.0*tanh(0.5*theta_s))-0.5;
    C=(1.0-theta_b).*Ptheta+theta_b.*Rtheta;
  else
    C=s;
  end