?? feasible_point.m
字號(hào):
function result = feasible_point(con,p)% Check the feasibility of the point "p" with respect to "con"%% Syntax:% "result = feasible_point(con,p)"%% Description:% "feasible_point(con,p)" returns "1" if the point "p" satisfies the linear% constraints represented by "con", and "0" if "p" does not. %% Examples:% Given the linear constraint object "con" representing a square in the% plane x3=0 with corners at (x1,x2) pairs (2,1), (2,3), (4,3), and% (4,1) and point "p = [3 2 0]'".%%%% "result = feasible_point(con,p)"%% "result = 1"%%%% Now use "p = [5 4 2]'". %%%% "result = feasible_point(con,p)"%% "result = 0"%%%% See Also:% linearconglobal GLOBAL_APPROX_PARAMepsilon = GLOBAL_APPROX_PARAM.poly_epsilon;% Equality constraints firstCE = con.CE; dE = con.dE;result = 1;for k = 1:length(dE) if abs(CE(k,:)*p - dE(k)) > epsilon result = 0; return endend% Inequality constraints nextCI = con.CI; dI = con.dI;result = 1;for k = 1:length(dI) if CI(k,:)*p > (dI(k) + epsilon) result = 0; return endend
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -