필터 지우기
필터 지우기

Why ParFor does not work for this?

조회 수: 2 (최근 30일)
Erdem Uguz
Erdem Uguz 2017년 12월 27일
답변: Namnendra 2022년 6월 19일
It is a really simple manipulation. I want to replace some lines of the matrix with zeros.
A=rand(20,20);
for j=1:1:4
A(4*j+1,:)=zeros;
end
When I replace for with parfor I get a classification error. But the results of the manipulation is independent from each other. I don't understand why.
Thank you Erdem

답변 (1개)

Namnendra
Namnendra 2022년 6월 19일
All variables referenced at the top level of the parfor must be resolved and classified. Go through the following link to know more :-
You can try putting the body of perfor loop into a function and calling the function from the loop.
I hope this helps.

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by