Running two functions in Parallel
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello everyone, I have following situation: I am running a simple simulation of motion. A point mass moving at a constant velocity in XY plane. Now, I need to call a function to capture an image. Image capturing function takes about 2 seconds. I need first simulation (motion) keep on running while running the image capturing function. Is there any parallel computing tool in MATLAB that could be run without hindering simulation platform? Please advise. Many thanks.
0 commentaires
Réponses (2)
Ken Atwell
le 16 Août 2013
Parallel Computing Toolbox's batch capability may do the trick for you. Fire off the image capture as a batch job while performing the simulation in the main process.
Walter Roberson
le 17 Août 2013
You cannot set equal times for statements inside parfor()
You should consider using a timer()
Note: a timer sounds like all you would need in your situation. Timers can interrupt between any two lines of MATLAB source. Unless you are doing uninterpretable real-time work in the simulation, you likely do not need parallelism.
0 commentaires
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!