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: mbdelete.m
    path of file: ./repos/Image-Harmonization-Dataset-iHarmony4/Lalonde and Efros/utils/3rd_party/multicore
    
    the code of the file until where you have to start completion: function deleteSuccessful = mbdelete(fileName, showWarnings, throwError)
%MBDELETE  Delete file and check possible warnings.
%   RESULT = MBDELETE(FILE) will check if file FILE is existing, try to
%   delete the file and check if the deletion caused a warning afterwards.
%   If the file could be deleted or was not existing, TRUE is returned,
%   otherwise FALSE.
%
%   RESULT = MBDELETE(FILE, SHOWWARNING, THROWERROR) with THROWERROR
%   evaluating to TRUE will cause MBDELETE to throw an error if Matlab
%   would have given a warning. With SHOWWARNING evaluating to false,
%   MBDELETE will not display a warning. Default values are THROWERROR =
%   FALSE and SHOWWARNING = TRUE.
%
%   Markus Buehren
%   Last modified 07.04.2009
%
%   See also DELETE, EXISTFILE, WARNING, LASTWARN.

showErrors = 0;

if existfile(fileName)
  % turn off file permission warnings
  warnID = 'MATLAB:DELETE:Permission';

    
function deleteSuccessful = mbdelete(fileName, showWarnings, throwError)
%MBDELETE  Delete file and check possible warnings.
%   RESULT = MBDELETE(FILE) will check if file FILE is existing, try to
%   delete the file and check if the deletion caused a warning afterwards.
%   If the file could be deleted or was not existing, TRUE is returned,
%   otherwise FALSE.
%
%   RESULT = MBDELETE(FILE, SHOWWARNING, THROWERROR) with THROWERROR
%   evaluating to TRUE will cause MBDELETE to throw an error if Matlab
%   would have given a warning. With SHOWWARNING evaluating to false,
%   MBDELETE will not display a warning. Default values are THROWERROR =
%   FALSE and SHOWWARNING = TRUE.
%
%   Markus Buehren
%   Last modified 07.04.2009
%
%   See also DELETE, EXISTFILE, WARNING, LASTWARN.

showErrors = 0;

if existfile(fileName)
  % turn off file permission warnings
  warnID = 'MATLAB:DELETE:Permission';
  warnState = warning('query', warnID);
  warning('off', warnID);

  % reset warnings and errors
  lastwarn('');
	lasterror('reset');

  % try to delete file
  try    
    delete(fileName); %% file access %%
    
    % check last warning
    [lastMsg, lastWarnID] = lastwarn;
    deleteSuccessful = ~strcmp(lastWarnID, warnID);
  
  catch
    % deleting caused an error
    deleteSuccessful = false;
    
    if showErrors
      disp(textwrap2(sprintf('Error thrown when trying to remove file %s:', fileName)));
      displayerrorstruct;
    end