function addCloudFolderToPath
% addCloudFolderToPath Add the cloud folder to the MATLAB path.
%
% addCloudFolderToPath adds the cloud folder and all its subfolders to the 
% MATLAB path. 
%
% In order to automatically add the cloud folder to the MATLAB path for
% every job, add a call to this function in your jobStartup.m file. 
%
% See also jobStartup,
%          parallel.internal.cloud.uploadToCloud
%          parallel.internal.cloud.getCloudFolder
%

    % Add the cloud folder (and all subfolders) to the MATLAB path. 
    location = parallel.internal.cloud.getCloudFolder();
    if ~isempty(location)
        cloudpath = genpath(location); 
        addpath(cloudpath);
    end
end
