Access variables in parallel computing
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello everyone,
I have a problem that I'm unsure how to solve:
I have a video camera recording during a task that gives a TTL signal per frame (approx 75 Hz) that I would like to count in the background while the main task is running. However to synchronize the signals I would like MATLAB to access the counter variable at certain points during the task and return the frame number. I have tried using the parallel computing toolbox, however I do not know how to access the counter variable in the background. Is there any way of doing this on one machine or how could this be best achieved?
Thanks in advance for the help,
John
3 commentaires
Alice
le 18 Juin 2024
Hi,
A bit late, but I have the same question : I need to access a variable in my main program that is being modified in the background. I can access it sometimes but it will stop updating the variable after some time and give me a constant value when the actual variable is changing, so I think that I'm not going about it the right way.
How did you solve your problem?
Thanks in advance,
Alice
Réponses (2)
Steven Lord
le 4 Avr 2022
2 commentaires
Steven Lord
le 4 Avr 2022
Doesn't this paragraph from the documentation page address that?
"Use parfeval with the background pool to run a function in the background. parfeval immediately returns a Future object that represents the function running in the background. To get results from the Future, call fetchOutputs."
Voir également
Catégories
En savoir plus sur Parallel Computing Toolbox 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!