make two while loop work parallely
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
John Carlson
il 17 Gen 2019
Commentato: John Carlson
il 20 Gen 2019
I want to run two while functions at the same time , for example make two cores of my computer work on loop 1 and two cores on loop 2 .
Is it possible in matlab ?
0 Commenti
Risposta accettata
Walter Roberson
il 17 Gen 2019
If you have the Parallel Computing Toolbox, you can use
parpool(2)
parfevalOnAll(@maxNumCompThreads, 0, 2)
spmd
if labindex == 1
first_function
else
second_function
end
end
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Parallel Computing Fundamentals in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!