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: setupFields.m
    path of file: ./repos/chebfun/@chebgui
    
    the code of the file until where you have to start completion: function [field, allVarString, indVarName, pdeVarNames, pdeflag, ...
    eigVarNames, allVarNames]  = setupFields(guifile, input, type, allVarString)
%SETUPFIELDS   Convert input from GUI window to format useful for Chebfun.
%
% Calling sequence:
%
%   [FIELD, ALLVARSTRING, INDVARNAME, PDEVARNAMES, PDEFLAG,  EIGVARNAMES, ...
%       ALLVARNAMES] = SETUPFIELDS(GUIFILE, INPUT, TYPE, ALLVARSTRING)
%
% Here, the inputs are:
%
%   GUIFILE:        A CHEBGUI object, describing the problem shown in the GUI.
%   INPUT:          The 'String' property of a particular input field of the GUI.
%   TYPE:           The type of the field (differential equation, boundary
%                   conditions or initial guess/condition).
%   ALLVARSTRING:   A strings, containing the name of all variables that appear
%                   in a problem.
%
% The outputs are:
%   FIELD:          A string that can be converted to anonymous function,
%                   describing the 
    
function if we have a BVP or EIG.
    
    % If we are working with an eigenvalue problem, the differential equation
    % will have important information on both sides of the = sign if we are
    % solving a generalized problem. In this case, we want to keep the input in
    % two separate strings in a cell-array.
    if ( strcmp(guifile.type, 'eig') && iscell(anFun) )
        field1 = ['@(', dummys, ',', allVarString, ') ', anFun{1}];
        field2 = ['@(', dummys, ',', allVarString, ') ', anFun{2}];
        field = {field1 ; field2};
    elseif ( ~strcmp(guifile.type, 'pde') && strcmp(type, 'DE') )
        field = ['@(', dummys, ',', allVarString, ') ', anFun];
        
    % Otherwise, add variables in front of what will be anonymous functions.
    % This is not needed for 'dirichlet', 'neumann', etc... This can only happen
    % in BCs, and in that case, allVarNames will be empty
    elseif ( ~isempty(allVarNames) )
        if ( commaSeparated )
            anFun = ['[', anFun, ']'];
        end
        
        if ( strcmp(type, 'BCnew') )
            field = ['@(', dummys, ',', allVarString, ') ', anFun];
        else
            field = ['@(', allVarString, ') ', anFun, ''];
        end
    else
        field = anFun;
    end
    
else % Have a system, go through each row
    % Keep track of every variable encountered in the problem
    allVarNames = {};
    allPdeVarNames = {};
    indVarName = [];
    anFun = cell(1, numOfRows);
    % Loop through the rows
    for k = 1:numOfRows
        [anFun{k}, indVarNameTemp, varNames, pdeVarNames, eigVarNames, dummy] = ...
            setupLine(guifile, input{k}, type);
        if ( strcmp(anFun{k}([1 end