How to use Display option to suppress output from optimproblem solve without specifying the algorithm?

23 ビュー (過去 30 日間)
SHC
SHC 2023 年 1 月 15 日
編集済み: SHC 2023 年 2 月 8 日
Hi,
I want to suppress the output from optimproblem solve and I know I can use optimset options as answerd in https://www.mathworks.com/matlabcentral/answers/1713385-how-to-suppress-output-from-optimproblem-solve as below:
opts=optimoptions(@fmincon,'Display','off');
solution = solve(problem,initialPoint2, 'Options',opts);
However, I don't want fo specify the algorithm like fmincon (because it can be changed), I just want to use the option for Display simply like below:
opts=optimoptions('Display','off');
solution = solve(problem,initialPoint2, 'Options',opts);
or
solution = solve(problem,initialPoint2, 'Display','off');
But, both give this error:
Error using optim.internal.problemdef.ProblemImpl/solveImpl
The value of 'GlobalSolver' is invalid. GlobalSolver must be a MultiStart or GlobalSearch object.
Error in optim.problemdef.OptimizationProblem/solve

回答 (1 件)

SHC
SHC 2023 年 1 月 31 日
編集済み: SHC 2023 年 2 月 8 日
I found a solution as below:
opts=optimset('Display','off');
solution = solve(problem,initialPoint2, 'Options',opts);

カテゴリ

Help Center および File ExchangeGlobal or Multiple Starting Point Search についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by