Error using fminunc function

2 ビュー (過去 30 日間)
Linn
Linn 2019 年 4 月 12 日
編集済み: Stephan 2019 年 4 月 12 日
Hi I am getting the following erroe when using "fminunc" command.
The code seems to work fine when I run using fminsearch. Does anyone know what could be the problem?
x01=[a1,b1,c1,d1,a2,b2,c2,d2,5];
opts=optimset('display','iter','tolfun',1e-15,'maxfuneval',20000,'tolx',1e-15,'maxiter',10000);
%minimised_coeff =fminsearch(@my_func,x01, opts)
minimised_coeff=fminunc(@my_func,x01,opts)
The code seems to work fine when I run using fminsearch. Does anyone know what could be the problem?
First-order
Iteration Func-count f(x) Step-size optimality
0 10 35345.4 6.52e+04
Attempt to execute SCRIPT roots as a function:
/Users/XXn/Documents/MATLAB/roots.m
Error in lineSearch
Error in lineSearch
Error in lineSearch

採用された回答

Stephan
Stephan 2019 年 4 月 12 日
編集済み: Stephan 2019 年 4 月 12 日
Hi,
you have a script that is named roots.m - roots is an inbuilt function. This causes problems. Rename your script to solve this issue.
Best regards
Stephan

その他の回答 (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