MATLAB: How to easily install the own custom toolbox on the workers in a MATLAB Distributed Computing Server 4.1 (R2009a) environment

MATLAB Parallel ServermatlabrcParallel Computing Toolbox

I have created my own toolbox which I want to make available to all workers on my Parallel Computing cluster. I am able to get this working if the script being executed on the workers starts with the following line:
addpath \\server\share\to\toolbox
or if I set the correct 'PathDependencies'.
However, I would like all workers to be able to use the functions from my toolbox without having to do this, i.e. just like with any normal MathWorks toolbox which work out-of-the-box.
Is there any way this can be done?

Best Answer

For the toolbox to be available to all workers, the command
addpath \\server\share\to\toolbox
should be automatically executed on all workers. To accomplish this, please edit the script file:
$MATLABROOT\toolbox\local\matlabrc.m
This script is automatically run when a worker starts. You can simply add the above mentioned line to this script file.
Please note though, on Windows by default MATLAB workers are executed under the SYSTEM account; depending on your network configuration this account might not have sufficient rights to access your toolbox when it is located on a network share. To resolve this issue you could change the account under which the "MATLAB Distributed Computing Server" service is run.