function varargout = setupProjectExample(arg,workDir)
% 

%   Copyright 2018-2020 The MathWorks, Inc.

metadata = findExample(arg);

% Determine workDir
if nargin < 2 || isempty(workDir)
    workDir = matlab.internal.examples.getWorkDir(metadata);
else
    workDir = matlab.internal.examples.validateWorkDir(workDir);
end

% Setup workdir.
matlab.internal.examples.setupWorkDir(workDir);

if nargout
    varargout{1} = workDir;
    varargout{2} = metadata;
end
end
