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: append_common.m
    path of file: ./repos/fecgsyn/subfunctions/data-generation/libs/fieldtrip/private
    
    the code of the file until where you have to start completion: function data = append_common(cfg, varargin)

% APPEND_COMMON is used for concatenating raw, timelock or freq data
%
% The general bookkeeping and the correct specification of the cfg
% should be taken care of by the calling function.
%
% See FT_APPENDDATA, FT_APPENDTIMELOCK, FT_APPENDFREQ

% Copyright (C) 2017, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
%

    
function data = append_common(cfg, varargin)

% APPEND_COMMON is used for concatenating raw, timelock or freq data
%
% The general bookkeeping and the correct specification of the cfg
% should be taken care of by the calling function.
%
% See FT_APPENDDATA, FT_APPENDTIMELOCK, FT_APPENDFREQ

% Copyright (C) 2017, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
%
%    FieldTrip is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    FieldTrip is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with FieldTrip. If not, see <http://www.gnu.org/licenses/>.
%
% $Id$

% when present, these must be consistent in all inputs
hastime       = isfield(varargin{1}, 'time');
hasfreq       = isfield(varargin{1}, 'freq');
hastrialinfo  = isfield(varargin{1}, 'trialinfo');
hassampleinfo = isfield(varargin{1}, 'sampleinfo');
hascumsumcnt  = isfield(varargin{1}, 'cumsumcnt');
hascumtapcnt  = isfield(varargin{1}, 'cumtapcnt');
hastopolabel  = isfield(varargin{1}, 'topolabel');
hastopo       = isfield(varargin{1}, 'topo');
hasunmixing   = isfield(varargin{1}, 'unmixing');
for i=2:numel(varargin)
  hastime       = hastime       && isfield(varargin{i}, 'time');
  hasfreq       = hasfreq       && isfield(varargin{i}, 'freq');
  hastrialinfo  = hastrialinfo  && isfield(varargin{i}, 'trialinfo');
  hassampleinfo = hassampleinfo && isfield(varargin{i}, 'sampleinfo');
  hascumsumcnt  = hascumsumcnt  && isfield(varargin{i}, 'cumsumcnt');
  hascumtapcnt  = hascumtapcnt  && isfield(varargin{i}, 'cumtapcnt');
  hastopolabel  = hastopolabel  && isfield(varargin{i}, 'topolabel');
  hastopo       = hastopo       && isfield(varargin{i}, 'topo');
  hasunmixing   = hasunmixing   && isfield(varargin{i}, 'unmixing');
end