problem with parfor in a subroutine

Dear;
I rather new using parfor computation.
The parfor execute a program in a parallel basis, when this program arrive to a routine:
function Erz=EFieldCalIdeal(r,z,V,RThimble,RCentral,LCentral)
for i=1:length(r)
...
if r(i)<=RThimble
28 Erz(i,1)=F/r(i);
elseif
...
end
end
end
Gives the following error:
Error using EFieldCalIdeal (line 28)
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
But in fact, the program has no problem to run using a conventional for-loop.
Any idea?
Thanks a lot,

댓글 수: 3

Walter Roberson
Walter Roberson 2019년 4월 9일
Is the parfor in the calling routine, or in this routine?
It looks to me as if F is non-scalar when the problem occurs.
Luis Isaac
Luis Isaac 2019년 4월 9일
The parfor call the routine
Walter Roberson
Walter Roberson 2019년 4월 9일
Is there any randomness involved inside the parfor ? And is there any solve() involved? How is F being constructed ?

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

태그

질문:

2019년 4월 9일

댓글:

2019년 4월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by