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: read_bucn_nirsdata.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/external/fieldtrip/fileio/private
    
    the code of the file until where you have to start completion: function [dat] = read_bucn_nirsdata(filename, hdr, begsample, endsample, chanindx)

% READ_BUCN_NIRSDATA reads ASCII-formatted NIRS data acquired with the

    
function [dat] = read_bucn_nirsdata(filename, hdr, begsample, endsample, chanindx)

% READ_BUCN_NIRSDATA reads ASCII-formatted NIRS data acquired with the
% UCL-BIRKBECK machine and postprocessed by the Paris group. The first line
% contains the channel labels and the rest of the file contains per line a
% time sample. The first column specifies the time axis.
%
% Use as
%   [dat] = read_bucn_nirsdata(filename, hdr, begsample, end