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: pspm_split_sessions.m
    path of file: ./repos/PsPM/src
    
    the code of the file until where you have to start completion: function varargout = pspm_split_sessions(datafile, markerchannel, options)
% ● Description
%   pspm_split_sessions splits experimental sessions/blocks, based on
%   regularly incoming markers, for example volume or slice markers from an
%   MRI scanner, or based on a vector of split points that is defined in
%   terms of markers. The first and the last marker will define the start of
%   the first session and the end of the last session.
% ● Format
%   newdatafile = pspm_split_sessions(datafile, markerchannel, options)
% ● Arguments
%            datafile:  a file name
%       markerchannel:  (optional)
%                       number of the channel containing the relevant markers.
%   ┌─────────options:
%   ├──────.overwrite:  [logical] (0 or 1)
%   │        
    
function to use all the markers to evaluate
%   │                   the mean distance between them.
%   │                   Usefull for random ITI since it reduces the variance.
%   ├─────────.verbose: [default:1]
%   │                   printing processing messages
%   └─────────.missing: Optional name of an epoch file, e.g. containing a
%                       missing epochs definition in s. This is then split
%                       accordingly.
% ● Outputs
%          newdatafile: cell array of filenames for the individual sessions
%         newepochfile: cell array of missing epoch filenames for the individual
%                       sessions (empty if no options.missing not specified)
% ● Developer's notes
%   epochs have a fixed sampling rate of 10000
%   REMARK for suffix and prefix:
%   Markers in the prefix and suffix intervals are ignored. Only markers
%   between the splitpoints are considered for each session, to avoid
%   duplication of markers. 
% ● History
%   Introduced in PsPM 5.1.1
%   Written in 2021 by Dominik R Bach (Wellcome Trust Centre for Neuroimaging)
%   Updated and maintained in 2022 by Teddy Chao (UCL)

%% 1 Initialise
global settings
if isempty(settings)
  pspm_init;
end
sts = -1;
newdatafile = [];

% 1.1 Check input arguments
if nargin<1
  warning('ID:invalid_input', 'No data.\n');
  return;
end

% 1.2 Set options
if ~exist('options','var') || isempty(options) || ~isstruct(options)
  options = struct();
end