Filter löschen
Filter löschen

How to solve the following error when using PSOGWO to optimize an objective function ?

2 Ansichten (letzte 30 Tage)
I am using PSOGWO algorithm to optimize the following function:
function f = simple_fitness_two_bodies(x)
load ww2b.mat; % 100*1
load gh2b.mat; %100*2500
Wd=eye(100);
WM=diag(sqrt(gh2b'*gh2b));
wm=diag(WM);
mapr=zeros(2500,1);
PHm=0;
for j=1:2500;
PHm=PHm+(wm.^2*(1-exp(-abs(x(:)-mapr))));
end
f=norm(Wd*(gh2b*x(:)-ww2b),2)+15.8489*PHm;
and I have the following error....
Operands to the || and && operators must be convertible to logical scalar values.
Error in PSOGWO (line 38)
if fitness>Alpha_score && fitness<Beta_score
Error in main (line 28)
[Best_score,Best_pos,PSOGWO_cg_curve]=PSOGWO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
>>

Antworten (0)

Kategorien

Mehr zu Problem-Based Optimization Setup finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by