MATLAB Engine RunOptions do not seem to work with parfeval
1 次查看(过去 30 天)
显示 更早的评论
I am using MATLAB Engine with 2023b. When I specify a TextWriter in RunOptions, the expected behavior is that all disp() functions well send the value to the TextWriter. This works for the client portion of the function. If I create a worker thread using parfeval and provide a dataQueue, I expected to be able to make calls to disp basically the same way.
msg = parallel.pool.DataQueue;
msg.afterEach(@disp);
However, the behavior that I'm seeing is that these messages end up in the MATLAB Command Window.
Is there any way around this? Can I get the disp calls from the worker thread to use the same TextWriter that was specified in RunOptions?
Also, if I use MATLAB Runtime, then the messages in afterEach(@disp) do not show up at all.
2 个评论
Sam Marshalik
2024-4-11
Hey Nolin, can you provide a bit more information about your situation and goal.
Are you looking to create a DataQueue between multiple threaded workers or something else?
parfeval workers run in the background, so how are you looking to collect their displays output?
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 C Shared Library Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!