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: split_edges.m
    path of file: ./repos/gptoolbox/mesh
    
    the code of the file until where you have to start completion: function [U,FF,J] = split_edges(V,F,E,varargin)
  % SPLIT_EDGES Split given edges E in their barycenters within a mesh (V,F)
  %
  % Inputs:
  %   V  #V by dim list of mesh vertices
  %   F  #F by 3 list of mesh corners
  %   E  #E by 2 list of edges
  % Outputs:
  %   U  #V+#E by dim list of new mesh vertices
  %   FF #FF by 3 list of new mesh face corners into U
  %   J  #FF list of birth faces
  %
  % Known bugs: this has not been tested for non-manifold edges in E, though it
  % should probably work.
  % 

  max_iter = inf;

    
function [U,FF,J] = split_edges(V,F,E,varargin)
  % SPLIT_EDGES Split given edges E in their barycenters within a mesh (V,F)
  %
  % Inputs:
  %   V  #V by dim list of mesh vertices
  %   F  #F by 3 list of mesh corners
  %   E  #E by 2 list of edges
  % Outputs:
  %   U  #V+#E by dim list of new mesh vertices
  %   FF #FF by 3 list of new mesh face corners into U
  %   J  #FF list of birth faces
  %
  % Known bugs: this has not been tested for non-manifold edges in E, though it
  % should probably work.
  % 

  max_iter = inf;
  vis = false;
  % Map of parameter names to variable names
  params_to_variables = containers.Map( ...
    {'MaxIter','V'}, ...
    {'max_iter','V'});
  v = 1;
  while v <= numel(varargin)
    param_name = varargin{v};
    if isKey(params_to_variables,param_name)
      assert(v+1<=numel(varargin));
      v = v+1;
      % Trick: use feval on anonymous function to use assignin to this workspace 
      feval(@()assignin('caller',params_to_variables(param_name),varargin{v}));
    else
      error('Unsupported parameter: %s',varargin{v});
    end