function copyIfMissing(src,target)
%

%   Copyright 2017-2020 The MathWorks, Inc.

    if isfolder(src)
        if ~isfolder(target)
            copyfile(src, target, 'f');
            fileattrib(target,'+w')
        end
    elseif ~fileExists(target)
        copyfile(src,target,'f');
        fileattrib(target,'+w')
    end
end

function tf = fileExists(f)
tf = numel(dir(f)) == 1;
end
