开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜