Remove function from all Polyhedra in the union based on the function name.
U = removeFunction(U,name)
U.removeFunction(name)
U |
Object of the PolyUnion class that holds polyhedra in the same dimension. Class: PolyUnion |
name |
Name of the function to remove from the union. String must match one of the names as retrieved by listFunctions
method.For multiple names, provide name as a cell array of strings. Class: char |
U |
Modified object of the PolyUnion class without the function handles that has been removed. Class: PolyUnion |
P(1) = Polyhedron('lb',-2,'ub',0);
P(2) = Polyhedron('lb',-1,'ub',1);Define the functions
f1 = QuadFunction(2,-1,1);
f2 = QuadFunction(3,-2,0);Add these functions to the polyhedron array
P.addFunction(f1,'f1');
P.addFunction(f2,'f2');Create the PolyUnion object with some properties.
U = PolyUnion('Set',P,'Overlaps',true)
PolyUnion in the dimension 1 with 2 polyhedra. Properties of the union: Overlaps: 1 Functions : 2 attached "f1", "f2"Remove the function "f2" from the set
U.removeFunction('f2')
PolyUnion in the dimension 1 with 2 polyhedra. Properties of the union: Overlaps: 1 Functions : 1 attached "f1"Union of polyhedra now contains only 'f1' function
U.listFunctions
ans = 'f1'
◀ | reduce | removeallfunctions | ▶ |
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch