getting error in PSO code

8 次查看(过去 30 天)
Amisha Srivastava
Amisha Srivastava 2022-2-25
编辑: KSSV 2022-2-25
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.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by