% This function check if the specified file or folder exists.
% If exists, it will use the right API to delete the file or folder.

function deleteFileOrFolder(f)
if exist(f,'file')
    delete(f);
elseif exist(f,'dir')
    rmdir(f, 's')
end
end