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: besa2fieldtrip.m
    path of file: ./repos/fieldtrip
    
    the code of the file until where you have to start completion: function data = besa2fieldtrip(varargin)

    
function data = besa2fieldtrip(varargin)

% BESA2FIELDTRIP reads and converts various BESA datafiles into a FieldTrip
% data structure, which subsequently can be used for statistical analysis
% or other analysis methods implemented in Fieldtrip.
%
% Use as
%   [output] = besa2fieldtrip(input)
% where the input should be a string specifying the BESA file, or a MATLAB structure
% with data that was exported by BESA. The output is a MATLAB structure that is
% compatible with FieldTrip.
%
% The format of the output structure depend