add

Purpose

Insert set to Union object.

Syntax

U = add(U,Set)
U.add(Set)

Description

Insert the Set derived from from the ConvexSet inside the Union object. The Set can be also an array. Each element of the array is stored under Union.Set property as a cell array because objects derived from the ConvexSet class cannot be concatenated. If the Set is empty, it is not added to the union.

Input Arguments

U

The object of the Union class.

Class: Union

Set

A convex set derived from ConvexSet class.

Class: ConvexSet

Output Arguments

U

Union of the sets.

Class: Union

Example(s)

Example 1

Construct empty Union object.
U = Union
Empty Union.
Insert random polyhedron inside the union.
 U.add(ExamplePoly.randHrep); 
 The union now consist of one set.
 U.Set, U.Num 
ans = 

    [1x1 Polyhedron]


ans =

     1

Example 2

Union of YSet object and Polyhedron object. Define YSet object.
 x = sdpvar(2,1);

 F = [0<= x <= 1]; 

 Y = YSet(x,F); 
 Define Polyhedron object. 
 P = Polyhedron('lb',[2;0],'ub',[3;3]) 
Polyhedron in R^2 with representations:
    H-rep (redundant)   : Inequalities   4 | Equalities   0
    V-rep               : Unknown (call computeVRep() to compute)
Functions : none
Create the union
 U = Union(Y); U.add(P) 
Union of 2 convex sets.
Functions : none
Empty polyhedron object is not added
 U.add(Polyhedron) 
Union of 2 convex sets.
Functions : none

See Also

union, remove


© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch