Borrar filtros
Borrar filtros

problem with parfor in a subroutine

3 visualizaciones (últimos 30 días)
Luis Isaac
Luis Isaac el 9 de Abr. de 2019
Comentada: Walter Roberson el 9 de Abr. de 2019
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 comentarios
Luis Isaac
Luis Isaac el 9 de Abr. de 2019
The parfor call the routine
Walter Roberson
Walter Roberson el 9 de Abr. de 2019
Is there any randomness involved inside the parfor ? And is there any solve() involved? How is F being constructed ?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by