Failure in initial objective function evaluation. FMINUNC cannot continue.

14 ビュー (過去 30 日間)
Kelechi Emerole
Kelechi Emerole 2019 年 11 月 19 日
コメント済み: Star Strider 2020 年 8 月 15 日
I tried to evaluate this function but I am getting this error Failure in initial objective function evaluation.
FMINUNC cannot continue.
Please what is the best way to evaluate this function
f = x(2)^2*x(9)^2 + x(2)^2*x(9) + x(2)^3*x(9) - x(3)*x(5)*x(9)^2 + x(6)*x(8)*x(9)^2 + x(6)*x(8)*x(9)^3 + x(2)*x(6)*x(8)*x(9)^2;

採用された回答

Star Strider
Star Strider 2019 年 11 月 19 日
Unless it is already in a function file, it needs to be an anonymous function:
f = @(x) x(2)^2*x(9)^2 + x(2)^2*x(9) + x(2)^3*x(9) - x(3)*x(5)*x(9)^2 + x(6)*x(8)*x(9)^2 + x(6)*x(8)*x(9)^3 + x(2)*x(6)*x(8)*x(9)^2;
If it is in a function file (and you have passed the function handle to fminunc correctly), the initial parameter estimates could be the problem. Please post those.
  9 件のコメント
Mohammed Ouallal
Mohammed Ouallal 2020 年 8 月 15 日
編集済み: Bruno Luong 2020 年 8 月 15 日
It seems that you resolve the problem but did not show how! please be kind and share the complete solution.
Thank you for the understanding!
Star Strider
Star Strider 2020 年 8 月 15 日
Yes, I did!
Unless it is already in a function file, it needs to be an anonymous function

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by