Why do I receive an "Undefined command/function" message when I execute my function MATLAB file using DFEVAL from Distributed Computed Toolbox 1.0.1 (R14SP2)?
4 views (last 30 days)
Show older comments
I have an function MATLAB file called myfunc.m stored in a directory that is located on a Windows mapped network drive. To add this directory to my worker's path, I insert the following command in the jobStartup.m file:
addpath('T:\mydir')
Then I use DFEVAL to evaluate my function MATLAB file:
y=dfeval('myfunc',{1},{2},{3},'JobManager','MyJobManager','Filedependencies',{'$MATLAB\toolbox\distcomp\user\jobStartup.m'})
The jobStartup.m file is passed to the worker using the FileDependencies property so that the worker's path is correctly set. However, I receive the following warning and error message when DFEVAL executes:
Warning: Errors occurred during execution of task 1. Results may be incorrect.
Error using ==> feval
Undefined command/function 'myfunc'.
> In dfevalasync>taskFinish at 170
In distcomp.task.pDispatchJavaEvent at 22
In distcomp.objectroot.objectroot>nDispatchJavaEvent at 36
In distcomp.eventwaiter.waitForEvent at 33
In distcomp.job.waitForState at 90
In dfeval at 62
??? Error using ==> dfeval
Requested number of output arguments is greater than the number
of output arguments returned by the tasks. Data must be manually
retrieved from job 6.
I expect the worker to find myfunc.m because I specified the path.
Accepted Answer
MathWorks Support Team
on 27 Jan 2010
A Distributed Computing worker runs as a service. On Windows, a service does not know about network drive mappings. As a workaround, use UNC paths, e.g., \\mathworks\tempdir instead of T:\mydir in the ADDPATH command.
For example,
addpath('\\mathworks\tempdir')
0 Comments
More Answers (0)
See Also
See Also
Categories
Find more on Search Path in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!