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: qualitycheck_exportname.m
    path of file: ./repos/malini/Codes/deconvolution - model/spm8/external/fieldtrip/private
    
    the code of the file until where you have to start completion: function exportname = exportname_qualitycheck(dataset)

% EXPORTNAME_QUALITYCHECK is used in ft_qualitycheck and the associated cron job

[p, f, x] = fileparts(dataset);

if ft_filetype(dataset, 'ctf_ds')
  try
    info = read_ctf_hist(dataset);
    c = datevec(info.startdate);
    % construct something like 20070320_1230, i.e. YYYYMMDD_HHMM
    exportname = sprintf('%04d%02d%02d_%s%s.mat', c(1), c(2), c(3), info.starttime(1:2), info.starttime(4:5));
  catch

    
function exportname = exportname_qualitycheck(dataset)

% EXPORTNAME_QUALITYCHECK is used in ft_qualitycheck and the associated cron job

[p, f, x] = fileparts(dataset);

if ft_filetype(dataset, 'ctf_ds')
  try
    info = read_ctf_hist(dataset);
    c = datevec(info.startdate);
    % construct something like 20070320_1230, i.e. YYYYMMDD_HHMM
    exportname = sprintf('%04d%02d%02d_%s%s.mat', c(1), c(2), c(3), info.starttime(1:2), info.starttime(4:5));
  catch
    % the hist file is sometines empty
    % just use the dataset name, but exclude the full path
    exportname = [f, '.mat'];
  end