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: readBESAsfh.m
    path of file: ./repos/fieldtrip/external/besa
    
    the code of the file until where you have to start completion: function sfh = readBESAsfh(filename, chantype)
% READBESASFH reads BESA coregistration information from SFH-file. 
%
% Parameters:
%     [filename]
%         In the case that the current folder is not the folder containing 
%         the file it should be the full path including the name of the 
%         sfh file else only the name of the file should be specified. 
% 
%     [chantype]
%         Optional parameter. Defines a specific type of sensors that will
%         be stored in sfh. All other sensors will be ignored.
%         Options: 'all' - default value
%                  'fiducial' - only fiducials will be taken into account
%                  'hpi' - only head position indicators will be taken into
%                  account
%                  'eeg' - only eeg sensors will be taken into account
%
% Return:
%     [sfh] 
%         A Matlab structure containing the coregistration information
%         stored in the SFH-file.
% 
% Copyright (C) 2013, BESA GmbH
%
% File name: readBESAsfh.m
%
% Author: Todor Jordanov
% Created: 2013-10-02

IsReadingOK = 1;
DataLevel = 0;


    
function sfh = readBESAsfh(filename, chantype)
% READBESASFH reads BESA coregistration information from SFH-file. 
%
% Parameters:
%     [filename]
%         In the case that the current folder is not the folder containing 
%         the file it should be the full path including the name of the 
%         sfh file else only the name of the file should be specified. 
% 
%     [chantype]
%         Optional parameter. Defines a specific type of sensors that will
%         be stored in sfh. All other sensors will be ignored.
%         Options: 'all' - default value
%                  'fiducial' - only fiducials will be taken into account
%                  'hpi' - only head position indicators will be taken into
%                  account
%                  'eeg' - only eeg sensors will be taken into account
%
% Return:
%     [sfh] 
%         A Matlab structure containing the coregistration information
%         stored in the SFH-file.
% 
% Copyright (C) 2013, BESA GmbH
%
% File name: readBESAsfh.m
%
% Author: Todor Jordanov
% Created: 2013-10-02

IsReadingOK = 1;
DataLevel = 0;

% Open the sfh-file for reading.
fp = fopen(filename, 'r');

% Check if the file was opened succesfully.
if(fp < 0)
    
    disp('Error: File does not exist or not enough permissions!')
    IsReadingOK = 0;
    
end