How to find projection on a set

15 ビュー (過去 30 日間)
Yokuna
Yokuna 2022 年 2 月 18 日
回答済み: Matt J 2022 年 2 月 18 日
Let us define . We have
g1=(x1-100)*(x1-150)<=0;
g2=(x2-100)*(x2-150)<=0;
g3=(x3-100)*(x3-200)<=0; I want to find . Please help me find the projection fun P as defined. I tried this code but it gives error.
syms x1 x2 x3 g1 g2 g3 t
g1=(x1-100)*(x1-200)<=0;
g2=(x2-100)*(x2-200)<=0;
g3=(x3-100)*(x3-200)<=0;
% g1,g2,g3 has set of values of x1, x2, x3.
[difference, index_At_F_Equals_x1] = argmin(abs(g1-x1))
% Value of projection fun
P1 = g1(index_At_F_Equals_x1)
[difference, index_At_F_Equals_x2] = argmin(abs(g2-x2))
P2 = g2(index_At_F_Equals_x2)
[difference, index_At_F_Equals_x3] = argmin(abs(g3-x3))
P3 = g3(index_At_F_Equals_x3)

回答 (1 件)

Matt J
Matt J 2022 年 2 月 18 日
The set appears just to be a box, so,
lb=[100;100;100];
ub=[150;150;200];
P= @(x) min( max(x(:),lb) ub);

カテゴリ

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

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by