开发者

Determine whether MATLAB was launched from OS GUI or as a Parallel Toolbox thread

开发者 https://www.devze.com 2023-02-20 03:15 出处:网络
In a similar style to this question about R, is there a way to determi开发者_如何学Gone whether a given MATLAB instance was launched by the user or whether it was spawned by the parallel toolbox sched

In a similar style to this question about R, is there a way to determi开发者_如何学Gone whether a given MATLAB instance was launched by the user or whether it was spawned by the parallel toolbox scheduler?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消