Saving solution in each iteration in YalMIP

6 ビュー (過去 30 日間)
foroogh behroozi
foroogh behroozi 2023 年 4 月 18 日
コメント済み: Johan Löfberg 2023 年 4 月 27 日
Hello,
I want to save variable values and corresponding objective value in each iteration in YalMIP. Is there any special option in sdpsettings to do that? here is the simple example that I want to save its values.
% Define variables
n = 2;
x = sdpvar(n,1);
% Define parameters
Q = magic(n);
% Define constraints
constraints = [sum(x.^2) <=1, x(1) >= -1, x(2) >= 1];
% Defined an objective function
objective = x'*Q*x;
% Set some options for YALMIP and solver
options = sdpsettings('solver','moment','moment.order',3);
% Solve the problem
sol = optimize(constraints, objective, options);
  1 件のコメント
Johan Löfberg
Johan Löfberg 2023 年 4 月 27 日
https://github.com/yalmip/YALMIP/discussions

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by