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: GetVerticalLevels2.m
    path of file: ./repos/tracacode/1911-COAWST/script/mfiles/LP_Bathymetry/Mfiles
    
    the code of the file until where you have to start completion: function [Z_r, Z_w]=GetVerticalLevels2(DEP_rho, MSK_rho, ARVD)

    
function [Z_r, Z_w]=GetVerticalLevels2(DEP_rho, MSK_rho, ARVD)
    
% [Z_r, Z_w]=GetVerticalLevels2(DEP_rho, MSK_rho, ARVD)
%
% Z_r, Z_w are vertical Z level (negative values)
% DEP_rho is depth at rho points
% MSK_rho is mask at rho points
% (it works also for u points, vpoints, psi-points)
%
% ARVD is a record containing the description of vertical 
% stratification. For example:
% ARVD.Vtransform=2;
% ARVD.Vstretching=1;
% ARVD.ThetaS=4;
% ARVD.ThetaB=0.35;
% ARVD.N=30;
% ARVD.hc=10;



[Sc_w, Cs_w, Sc_r, Cs_r]=GRID_GetSc_Cs_V2(ARVD);
N=ARVD.N;

[eta_rho, xi_rho]=size(DEP_rho);
DEPwork=DEP_rho;
K=find(MSK_rho == 0);
DEPwork(K)=3;


Z_r=zeros(N, eta_rho, xi_rho);
Z_w=zeros(N+1, eta_rho, xi_rho);
if (ARVD.Vtransform == 1)
  for i=1:N
    Z_r(i,:,:)=ARVD.hc*Sc_r(i,1) + (DEPwork - ARVD.hc)*Cs_r(i,1);
  end