How to find projection on a set

1 次查看(过去 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 CenterFile Exchange 中查找有关 Mathematics 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by