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 ?

 채택된 답변

Walter Roberson
Walter Roberson 2019년 1월 17일

0 개 추천

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개)

nanren888
nanren888 2019년 1월 17일

0 개 추천

Sure, run two Matlabs.
Why?

댓글 수: 1

John Carlson
John Carlson 2019년 1월 20일
It's not possible for some problems.
For example if you are connecting with a raspberry pi you can only publish one connection through one matlab .

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Parallel Computing Toolbox에 대해 자세히 알아보기

질문:

2019년 1월 17일

댓글:

2019년 1월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by