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