solve constraint optimization problem
1 次查看(过去 30 天)
显示 更早的评论
I want to solve constraint optimization problem :
min||M||^2 , where the norm is the frobinus norm and M is 2×2 matrix =[1 x;x 1+2x]
i wrote like that but i got error
x = optimvar('x');
prob = optimproblem;
M=[1 x;x 1+2*x]
prob.Objective = norm(M,'fro')^2;
prob.Constraints.cons1 = x^2-2*x <=1
prob.Constraints.cons2 = x >=- 1/2;
sol = solve(prob,x)
0 个评论
采纳的回答
Torsten
2023-2-28
x = optimvar('x');
prob = optimproblem;
M=[1 x;x 1+2*x];
prob.Objective = norm(M,'fro')^2;
prob.Constraints.cons1 = x^2-2*x <=1;
prob.Constraints.cons2 = x >=- 1/2;
x0.x = 1;
sol = solve(prob,x0)
2 个评论
Torsten
2023-2-28
Then you use an older MATLAB version.
Take a look at your older documentation on how to supply initial values for the solution variables.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!