Particle swarm UseParallel issur

1 view (last 30 days)
Alexandros Filippas
Alexandros Filippas on 2 Mar 2023
Answered: Walter Roberson on 2 Mar 2023
I use particle swarm to fit a model to my data by minimizing an error function. When I run it serially it gives me the right answer but when I try to use the parallel option it gives me a nonsense fit and a value of 0 for the objective function. Has anybody encountered a similar problem?

Answers (1)

Walter Roberson
Walter Roberson on 2 Mar 2023
That can happen if the fit function depends upon global variables, or upon persistent variables that are established beforehand . Or in some cases involving "objects" that are not serializable.

Community Treasure Hunt

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

Start Hunting!