In a similar style to this question about R, is there a way to determine whether a given MATLAB instance was launched by the user or whether it was spawned by the parallel toolbox scheduler?
Asked
Active
Viewed 103 times
1 Answers
0
Warning: untested code
This seems like it might do the trick:
if isempty(getCurrentWorker)
% Do things if launched as a worker
else
% Do things if launched in a GUI session
end
Here's the reference: http://www.mathworks.com/help/toolbox/distcomp/getcurrentworker.html

Pablo
- 8,644
- 2
- 39
- 29
-
1I think you'd be better off using getCurrentTask rather than getCurrentWorker. getCurrentWorker only works on the job manager, not the other schedulers. – richardthe3rd Mar 28 '11 at 19:55