How to suppress output from optimproblem solve?
조회 수: 43 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
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
2022년 5월 7일
opts=optimoptions(@fmincon,'Display','off');
solution = solve(problem,initialPoint2, 'Options',opts);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Least Squares에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!