Error with 'barrier' function

8 ビュー (過去 30 日間)
Xinru Li
Xinru Li 2021 年 2 月 1 日
回答済み: Walter Roberson 2021 年 2 月 2 日
When I run my code, it shows:
Unrecognized function or variable 'barrier'.
Error in fmincon (line 834)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...
Error in globalMaximization (line 38)
[ optimum, fval] = fmincon(neg_target, start, [], [], [], [], xmin, xmax, [], ...
Error in ucb_choose (line 16)
optimum = globalMaximization(acfun, xmin, xmax, [guesses;xx]);
Error in add_gpopt (line 91)
optimum = ucb_choose(xx_sub, yy, KernelMatrixInv, [], ...
Error in example_addgp (line 33)
add_gpopt(f, xmin, xmax, 200, [], [], options)
I searched online, there are many problems about error in 'barrier', but nobody asked about missing function. I know that I do not have 'barrier' function, but is there any one know that how should I install it?
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 2 月 2 日
Are you referring this function?
https://web.stanford.edu/~boyd/MTSOS/barrier.html
Walter Roberson
Walter Roberson 2021 年 2 月 2 日
No, barrier is a Mathworks function in this context.

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

採用された回答

Walter Roberson
Walter Roberson 2021 年 2 月 2 日
barrier is normally installed in toolbox/optim/optim/barrier.p
It is part of the Optimization Toolbox, which is the same toolbox as fmincon itself. barrier() is the implementation for Interior Point
Either your MATLAB path is messed up, or you need to reinstall Optimization Toolbox. (Or install it the first time if somehow you got a copy of fmincon without the toolbox)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by