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: artifact2boolvec.m
    path of file: ./repos/spm/external/fieldtrip/private
    
    the code of the file until where you have to start completion: function boolvec = artifact2boolvec(artifact, varargin)

% ARTIFACT2BOOLVEC converts between two representations of events or trials.

    
function boolvec = artifact2boolvec(artifact, varargin)

% ARTIFACT2BOOLVEC converts between two representations of events or trials.
%
% FieldTrip uses a number of representations for events that are conceptually very similar
%   event    = structure with type, value, sample, duration and offset
%   trl      = Nx3 numerical array with begsample, end