Fmincon Error Message please help!

조회 수: 11 (최근 30일)
Lori
Lori 2022년 8월 7일
답변: Walter Roberson 2022년 8월 8일
When I try to run
pO = [5350 535 1000 1200 0.00002 30 100 0.912 500 15 120000 800000 0.00004 2.5 0.009263 4.3 1 0.01 0.076 15 0.01 1.27 0.001 0.5 10 18 1.09 0.002 0.001];
lb = [1000 100 500 600 0.00001 20 50 0.5 200 10 100000 500000 0.00001 1.5 0.005263 1.43 0.5 0.008 0.03 5 0.0006 0.5 0.0008 0.3 8 15 1 0.001 0.0008];
ub = [53500 5350 5000 2000 0.00005 100 300 1.5 1000 30 400000 10000000 0.00008 5 0.02 10 2 0.05 0.1 40 0.05 2.7 0.002 1 12 20 1.11 0.005 0.005];
p = fmincon(@Obj_Complex,pO,[],[],[],[],lb,ub);
it gives me this error
Error in fmincon (line 568)
initVals.f = feval(funfcn{3},X,varargin{:});
Error in Fancy (line 8)
p = fmincon(@Obj_Complex,pO,[],[],[],[],lb,ub);
Caused by:
Failure in initial objective function evaluation. FMINCON cannot continue.
  댓글 수: 1
Steven Lord
Steven Lord 2022년 8월 7일
Since the error occurs in your objective function, without seeing the code of Obj_Complex it will be impossible to offer any specific guidance.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2022년 8월 8일
In order to get that error at that line of code, your function Obj_Complex had to have generated an error message when evaluated passing in p0. You can see the error by executing
Obj_Complex(p0)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by