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: systemDependentParse.m
    path of file: ./repos/automagic/preprocessing
    
    the code of the file until where you have to start completion: function [EEG, EOG, EEGSystem, MARAParams] = ...
                        systemDependentParse(EEG, EEGSystem, ...
                        ChannelReductionParams, MARAParams, ORIGINAL_FILE) %#ok<INUSD>
% systemDependentParse parse EEG input depending on the EEG system.
%   This function prepares the input for preprocessing. It makes sure that
%   the correct channel location field is a part of the input EEG. In
%   addition, it makes sure the reference channel is detected. If no
%   reference channel is provided, an additional channel containing zeros
%   is concatenated as a last channel. As a next step, it separates the EEG
%   from EOG for further processing. It also excludes specified channels
%   from the preprocessing. In the end, it makes sure the correct mapping
%   for the MARA ICA is provided.
%
%   EEG is the EEG/EOG input data loaded from the file.
%   
%   EEGSystem must be a structure with fields 'name', 'sys10_20', 'refChan', 
%   'locFile' and 'fileLocType'.  EEGSystem.name can be either 'EGI' or 
%   'Others'. EEGSystem.sys10_20 is a boolean indicating whether to use 
%   10-20 system to find channel locations or not. All other following 
%   fields are optional if EEGSystem.name='EGI' and can be left empty. 

    
function [EEG, EOG, EEGSystem, MARAParams] = ...
                        systemDependentParse(EEG, EEGSystem, ...
                        ChannelReductionParams, MARAParams, ORIGINAL_FILE) %#ok<INUSD>
% systemDependentParse parse EEG input depending on the EEG system.
%   This function prepares the input for preprocessing. It makes sure that
%   the correct channel location field is a part of the input EEG. In
%   addition, it makes sure the reference channel is detected. If no
%   reference channel is provided, an additional channel containing zeros
%   is concatenated as a last channel. As a next step, it separates the EEG
%   from EOG for further processing. It also excludes specified channels
%   from the preprocessing. In the end, it makes sure the correct mapping
%   for the MARA ICA is provided.
%
%   EEG is the EEG/EOG input data loaded from the file.
%   
%   EEGSystem must be a structure with fields 'name', 'sys10_20', 'refChan', 
%   'locFile' and 'fileLocType'.  EEGSystem.name can be either 'EGI' or 
%   'Others'. EEGSystem.sys10_20 is a boolean indicating whether to use 
%   10-20 system to find channel locations or not. All other following 
%   fields are optional if EEGSystem.name='EGI' and can be left empty. 
%   But in the case of EEGSystem.name='Others':
%   EEGSystem.refChan.idx the index of the reference channel in dataset. 
%   If it's left empty, a new reference channel will be added as the last 
%   channel of the dataset where all values are zeros and this new channel 
%   will be considered as the reference channel. If 
%   EEGSystem.refChan == struct([]) no reference channel is added and no 
%   channel is considered as reference channel at all. 
%   EEGSystem.locFile must be the name of the file (preferably) located 
%   in 'matlab_scripts' folder that can be used by pop_chanedit to find 
%   channel locations and finally EEGSystem.fileLocType must be the type 
%   of that file. Please see pop_chanedit for more information. Obviously 
%   only types supported by pop_chanedit are supported.
%
%   ChannelReductionParams has a field 
%   ChannelReductionParams.tobeExcludedChanswhich is an array of 
%   numbers indicating indices of the channels to be excluded from the 
%   analysis
%
%   EOGRegressionParams has a field performEOGRegression that 
%   must be a boolean indication whether to perform EOG Regression or not. 
%   The default value is 'EOGRegressionParams.performEOGRegression = 1'
%   which performs eog regression. The other field 
%   EOGRegressionParams.eogChans must be an array of numbers 
%   indicating indices of the EOG channels in the data.
%
%   ORIGINAL_FILE is necassary only in case of *.fif files. In that case,
%   this should be the address of the file where this EEG data is loaded
%   from.

%   MARAParams is explained in detail in performMARA.m
%
% Copyright (C) 2017  Amirreza Bahreini, methlabuzh@gmail.com
% 
% This program 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.
% 
% This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
Csts = PreprocessingConstants;

% Get the exclude channel list
defaults = DefaultParameters.ChannelReductionParams;
recs = Recommend