How to find projection on a set
2 ビュー (過去 30 日間)
古いコメントを表示
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)
0 件のコメント
回答 (1 件)
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);
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!