How can I run two function in parallel?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
K M Ibrahim Khalilullah
el 14 de Ag. de 2016
Editada: K M Ibrahim Khalilullah
el 16 de Ag. de 2016
I want to run two function in parallel for execution time minimization. Is it possible in matlab. I have two function func1 and func2. The func2 depends on func1. func2 takes 2.5 second and func2 takes 1.5 second for execution. i want to run func1 and func2 simultaneously for reducing execution time. If the two function run simultaneously, then func2 have to wait only for 1s (may be)............
5 comentarios
Pawel Ladosz
el 15 de Ag. de 2016
I don't see how this could happen, unless you can run parts of func2 without the output of func1. In that case you could try and split func2 into two more functions, one of which could be run parallel with func1.
Respuestas (1)
Walter Roberson
el 15 de Ag. de 2016
Use spmd . You can transfer data from one worker to the other using labSend() and labReceive()
3 comentarios
Walter Roberson
el 15 de Ag. de 2016
Yes, as usual, the local workspace of a function will be destroyed when the function returns.
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!