Different Results when calling feval
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
EmaG
el 7 de Ag. de 2017
Respondida: Walter Roberson
el 7 de Ag. de 2017
Hi all,
When I call my function in a parfor loop via feval it just returns zeros.
The same setting but without parfor returns the actual and correct results of the function. I just checked it going through the built-in genetic algorithm functions step by step when 'UseParallel' is set as true (whilst 'UseVectorized' already set as false).
What am I missing? How does the structure of my handled function affect the result? Unfortunately, I can not paste here the body of the function.
Thanks in advance!
1 comentario
Jan
el 7 de Ag. de 2017
It is impossible to guess, why the code does, what it does, without seeing it. If you cannot show us the code, helping is based on guessing.
Respuesta aceptada
Walter Roberson
el 7 de Ag. de 2017
Global variables and persistent variables are not copied into the clients of parfor workers.
You might be able to use https://www.mathworks.com/help/distcomp/pctrunonall.html or https://www.mathworks.com/help/distcomp/parfevalonall.html to make the appropriate assignments.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Genetic Algorithm en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!