Traditionally, MATLAB code runs serially, with each function completing before the next can begin. It has been possible to use the Parallel Programming toolbox, although that is more focused on running analysis in parallel. With MATLAB 2021b a major update to the language is the addition of parallel function evaluation (parfeval
), and the frameworks to run background tasks (futures) as a core feature:
https://www.mathworks.com/help/matlab/background-processing.html
This may help when designing experiment code where you want to run a background task without blocking your main control loop.