getting error in PSO code

8 visualizzazioni (ultimi 30 giorni)
Amisha Srivastava
Amisha Srivastava il 25 Feb 2022
Modificato: KSSV il 25 Feb 2022
Hi,
I am trying to run the hybrid GA-PSO code on matlab for optimizing my objective function but I am getting this error
Array dimensions must match for binary array op.
Error in gapso (line 169)
particle(i).Velocity = w*particle(i).Velocity + c1*rand(VarSize).*(particle(i).Best.Position-particle(i).Position) +
c2*rand(VarSize).*(GlobalBest.Position-particle(i).Position);
Please help me how to resolve this.

Risposte (0)

Categorie

Scopri di più su Problem-Based Optimization Setup in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by