1
votes

I have two systems running on MATLAB: the control system and the computer vision system.

The control system needs to receive three variables generated by the computer vision system periodically. However, I can't single thread both systems, because the computer vision system latency is too high compared with the control system latency.

I tried to run each program in a different MATLAB session and use a .mat file as interface between both sessions, but it did not work.

I'm not familiar with the Parallel Computing Toolbox. So I was wondering if someone can help with this? Or at lest give a start up idea, because, as I've said, I will start to learn the Parallel Computing Toolbox now.

2
So @Diogo did you solve your problem? - Benoit_11
@Benoit_11, as my time to do the work is almost finishing, I came back to THE solution I was using before, two MATLAB sessions. Anyway, thanks for the help. Next time I will try to use your suggestion. - Diogo Cosin

2 Answers

2
votes

I think the function in the Parallel Computing Toolbox you may be looking for is parfeval. It lets you spawn an asynchronous task, and get its result whenever it is ready.

2
votes

In addition to parfeval as suggested by @Dima you might also want to look into labSendReceive and associated function like labSend and labReceive which allow to share data between individual workers in your parallel pool. I guess which one is best for you depends on the type of calculation you want to do.