Different Results when calling feval

조회 수: 1 (최근 30일)
EmaG
EmaG 2017년 8월 7일
답변: Walter Roberson 2017년 8월 7일
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
Jan
Jan 2017년 8월 7일
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.

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

채택된 답변

Walter Roberson
Walter Roberson 2017년 8월 7일
Global variables and persistent variables are not copied into the clients of parfor workers.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by