Failure in initial user-supplied objective function evaluation.

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.

Antworten (1)

Torsten
Torsten am 3 Jun. 2016

0 Stimmen

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.

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Tags

Noch keine Tags eingegeben.

Gefragt:

am 3 Jun. 2016

Beantwortet:

am 3 Jun. 2016

Community Treasure Hunt

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

Start Hunting!

Translated by