How to execute and run 2 different of codes simultaneously?

Hi, I have two different codes to collect 2 different of data from 2 different devices? How to run the two codes simultaneously?

Answers (1)

Ameer Hamza
Ameer Hamza on 2 May 2018
Edited: Ameer Hamza on 2 May 2018
You will need Parallel Computing Toolbox. Or if the device creates a MATLAB event on receiving a data, you can modify your code to add a listener to the event. That way, you listener callback function will be executed whenever data is received from a device. The listener callback will not block execution when no data is being received, and you can do some other task.

Asked:

on 2 May 2018

Edited:

on 2 May 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!