Failure in initial objective function evaluation. FMINCON cannot continue.

I am calculating the optimum conditions for milling process but its showing the following error on running "Failure in initial objective function evaluation. FMINCON cannot continue."Can anyone please hhelp me in solving it.I have attached the files in it too.The first file reads the data from an excel file and second file has the population balance method which has to be minimized.
The error is shown:
Output argument "y" (and maybe others) not assigned during call to "Pbmsearch".
Error in fmincon (line 567)
initVals.f = feval(funfcn{3},X,varargin{:});
Error in parameter (line 24)
[x,fval,exitflag]=fmincon(@Pbmsearch,x0,[],[],[],[],lb,ub);
Caused by:
Failure in initial objective function evaluation. FMINCON cannot continue.

 채택된 답변

Matt J
Matt J 2021년 6월 16일

0 개 추천

The problem has nothing to do with fmincon. You must first make sure that your objective function runs without errors at x0.

댓글 수: 6

Oh it runs, actually it is getting the initial data from excel.
this error comes after running the files with excel.
When I run Pbmsearch on x0 at the command line, I get no output:
>> x0
x0 =
1.4000 2.4000 2.2000 4.5000 4.0000 1.0000 0.9000
>> Pbmsearch(x0)
>>
Also, it is a bad idea to use global variables. You should pass MeasuredPsd to Pbmsearch using one of the other techniques discussed here:
thanks i have rewritten the functions and solved and got the answers.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 6월 16일

댓글:

2021년 6월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by