필터 지우기
필터 지우기

How to find projection on a set

조회 수: 5 (최근 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에서 Linear Algebra에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by