Failure in initial user-supplied objective function evaluation.
Mostra commenti meno recenti
in script :
function f = zdt1(x)
% jbods %
Pmax = 30;
Mmax = 6;
f(1) = x(1)/Pmax;
f(2) = log10(0.5)/log10(x(2));
f(3) = 1-log2(x(3))/log2(Mmax);
end
in main:
fitnfct = @zdt1;
nvar=3;
LB=[1,1,1];
UB=[60, 8 , 4];
opt = saoptimset('Display','iter',...
'reannealinterval',300,...
'PlotFcn',{@saplotbestf,@saplottemperature,@saplotf,@saplotstopping});
[xf,fval,exitflag] = simulannealbnd(fitnfct,[0 0],LB,UB,opt);
error:
Error in mainzdt3SA (line 8)
[xf,fval,exitflag] = simulannealbnd(fitnfct,[0 0],LB,UB,opt);
Caused by:
Failure in initial user-supplied objective function evaluation.
Risposte (1)
Torsten
il 3 Giu 2016
0 voti
1. If you supply lower and upper bounds for three variables (LB=[1,1,1]; UB=[60, 8 , 4];), you also have to supply an initial guess for three variables ([ 0 0]).
2. fitnfct must return a single value, not a vector with three elements (f(1)=...,f(2)=...,f(3)=...).
Best wishes
Torsten.
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!