フィルターのクリア

How to suppress output from optimproblem solve?

43 ビュー (過去 30 日間)
Keaton Ellis
Keaton Ellis 2022 年 5 月 6 日
コメント済み: Keaton Ellis 2022 年 5 月 8 日
I pulled code from the "Optimization" option in a Live Script into my own function to use for maximization.
The code works great, but I want to turn off the output because I am running the optimization problem and it is cluttering the output window.
I put the following modification to the code
% Define problem objective
problem.Objective = fcn2optimexpr(@func, vars, params, ...
"Display","off");
But I still receive the output message each time I run my function:
Solving problem using fmincon.
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the value of the optimality tolerance,
and constraints are satisfied to within the value of the constraint tolerance.
<stopping criteria details>
How do I properly edit the code from the live script to suppress output?

採用された回答

Matt J
Matt J 2022 年 5 月 6 日
編集済み: Matt J 2022 年 5 月 7 日
That's controlled in the call to solve().
opts=optimoptions(@fmincon,'Display','off');
solution = solve(problem,x0, 'Options',opts); %EDITED
  4 件のコメント
Matt J
Matt J 2022 年 5 月 7 日
opts=optimoptions(@fmincon,'Display','off');
solution = solve(problem,initialPoint2, 'Options',opts);
Keaton Ellis
Keaton Ellis 2022 年 5 月 8 日
@Matt J thank you! This works great, and helps clear up clutter.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Least Squares についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by