Test if the point is contained inside convex set YSet.
ts = S.contains(x)
ts = contains(S, x)
S |
A convex set described as YSet object. Class: YSet |
x |
A point given as vector. Note that for YSet with symmetric matrix variable,
the point x must be given as vector with symmetric terms. Class: double |
ts |
True if the point x is contained inside YSet
Class: logical Allowed values:
|
x = sdpvar(2,1);
F1 = [ [1 -2;-0.4 1;0.6 -5]*x<=[1;1.2;1.7] ];
F2 = [ 0.3*x'*x-4*x(1)+2*x(2)<=0.1 ];
P = YSet(x,F1);
C = YSet(x,F2);It is obvious that the point x=[0;0] must lie inside both sets. Define the point v and the array S.
v = [0;0];
S = [P;C];Check if the point is contained in both sets.
S.contains(v)
ans = 1 1We can plot the sets and the point x.
S.plot; hold on; text(v(1),v(2),'\bf x');
Plotting... 23 of 40
z = [5;-5];
S.contains(z)
ans = 0 1
◀ | mpt | display | ▶ |
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch