make two while loop work parallely
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2019-1-17
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
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!