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: cdt.m
    path of file: ./repos/gptoolbox/mesh
    
    the code of the file until where you have to start completion: function [VV,TT,FF,TN,IFF] = cdt(varargin)
  % CDT compute the constrained delaunay triangulation of a given mesh using
  % tetgen.
  %
  % [VV,TT,FF,TN,IFF] = cdt(V,F,'ParameterName',ParameterValue, ...)
  %
  % Inputs:
  %   V  #V by dim list of mesh positions
  %   F  #F by dim list of face indices
  %   Optional:
  %     'TriangleFlags' followed by a string of additional triangle flags, e.g.
  %       '-q'
  %     'TetgenFlags' followed by a string of additional tetgen flags, e.g.
  %       '-J'
  %     'UseBoundingBox' followed by whether to use an explicit bounding box
  %       rather than tetgen's convex hull
  %     'BoundingBoxPush' followed by a push factor to enlargen the bounding
  %       box around its centroid {1.01}
  %     'BoundingBoxUpsample' followed by a factor f, to upsample the bounding
  %       box faces until min(doublearea(BV,BF))<f*max(doublearea(V,F)) {inf}
  %     'Quiet' followed by tru
    
function code comes later. See below
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  clear varargin;
  % get a list of current variables in this scope, this is the input "state"
  variables = who;
  % get a temporary file's name
  tmpf = [tempname('.') '.mat'];
  % save the "state" to file, so we can get a md5 checksum
  save(tmpf,'-regexp',sprintf('^%s$|',variables{:}),'-ascii');
  % get md5 checksum on input "state", we append .cache.mat to the check sum
  % because we'll use the checksum as the cache file name
  [s,cache_name] = system(['/sbin/md5 -r ' tmpf ' | awk ''{printf "."$1".cache.mat"}''']);
  % clean up
  delete(tmpf);
  clear s tmpf variables;
  % If the checksum cache file exists then we've seen this input "state"
  % before, load in cached output "state"
  if(exist(cache_name,'file'))
    fprintf_(fid,'Cache exists. Using cache...\n');
    % use cache
    load(cache_name);
  % Otherwise this is the first time we've seen this input "state", so we
  % execute the function as usual and save the output "state" to the cache
  else
    fprintf_(fid,'First time. Creating cache...\n');


    dim = size(V,2);
    assert(numel(F) ==0 || dim >= size(F,2), sprintf( ...
      'dimension of V (%d) < simplex size (%d)',dim,size(F,2)));
    switch dim
    case 2
      % we're dealing with edges
      E = F;
      if use_bounding_box
        [BV,BF] = bounding_box([max(V)+eps;min(V)-eps]);
        dir = [sign(bsxfun(@minus,BV,mean(BV)))];
        mag_max = max(sqrt(sum(bsxfun(@minus,BV,mean(BV)).^2,2)));
        BV = bsxfun(@plus,bb_push*mag_max*dir,mean(BV));
        BE = [];
        EmBE = E;
      else
        BV = [];
        BF = [];
        % explicitly add convex hull
        F = delaunay(V);
        BE = outline(F);
        EmBE = setdiff(sort(E,2),sort(BE,2),'rows');
      end