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.

回答 (1 件)

Torsten
Torsten 2016 年 6 月 3 日

0 投票

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.

カテゴリ

ヘルプ センター および File Exchange で MATLAB についてさらに検索

タグ

タグが未入力です。

質問済み:

2016 年 6 月 3 日

回答済み:

2016 年 6 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by