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_load_channel.m
    path of file: ./repos/PsPM/src
    
    the code of the file until where you have to start completion: function [sts, data_struct, infos, pos_of_channel] = pspm_load_channel(fn, channel, channeltype)
% ● Definition
%   pspm_load_channel loads a single data channel and provides integrated
%   channel checking logic
% ● Format
%   [sts, data_struct, infos, pos_of_channel] = pspm_load_channel(fn, channel, channeltype)
% ● Arguments
%   ┌─────fn:   [char] filename / [struct] with fields

    
function [sts, data_struct, infos, pos_of_channel] = pspm_load_channel(fn, channel, channeltype)
% ● Definition
%   pspm_load_channel loads a single data channel and provides integrated
%   channel checking logic
% ● Format
%   [sts, data_struct, infos, pos_of_channel] = pspm_load_channel(fn, channel, channeltype)
% ● Arguments
%   ┌─────fn:   [char] filename / [struct] with fields
%   ├─.infos:
%   └──.data:
%    channel:   [numeric] / [char] / [struct]
%               ▶ numeric: returns this channel (or the first of a vector)
%               ▶ char
%                 'marker'  returns the first maker channel
%                           (see settings for permissible channel types)
%                 any other channel type (e.g. 'scr')
%                           returns the last channel of the respective type
%                           (see settings for permissible channel types)
%                 'pupil', 'sps', 'gaze_x', 'gaze_y', 'blink', 'saccade',
%                 'pupil_missing' (eyetracker channels)
%                           goes through the following precedence order,
%                           selects the first category that is found in the
%                           data, and returns the last channel of this
%                           category
%                           1.  Combined channels (e.g., 'pupil_c')
%                           2.  Non-lateralised channels (e.g., 'pupil')
%                           3.  Best eye pupil channels
%                           4.  Any pupil channels
%               ▶ struct: with fields
%                 ├─.channel: as defined for the 'char' option above
%                 └──.units: units of the channel
%   channeltype: [char] optional; any channel type as permitted per pspm_init;
%                 checks whether retrieved data channel is of the specified type
%                 and gives a warning if not
% ● Outputs
%                sts: [logical] 1 as default, -1 if unsuccessful
%                data_struct: a struct with fields .data and .header,
%                     corresponding to a single cell of a data cell array
%                     returned by pspm_load_data
%                infos: file infos as returned from pspm_load_data
%                pos_of_channel: index of the returned channel
% ● History
% Written in 2019 by Eshref Yozdemir (University of Zurich)
% Updated in 2024 by Dominik Bach (University of Bonn)
% Introduced in PsPM 6.1.2

% no checking of file and channel type as this is done downstream in
% pspm_load_data

% initialise
global settings;
if isempty(settings)
  pspm_init;
end