removeFunction

Purpose

Remove function from all Polyhedra in the union based on the function name.

Syntax

U = removeFunction(U,name)
U.removeFunction(name)

Description

Removes Function object from the union of polyhedra identified by the string name. The functions stored with the union can be retrieved using listFunctions method. Index or string must match with the corresponding arrays.

Input Arguments

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

Output Arguments

U

Modified object of the PolyUnion class without the function handles that has been removed.

Class: PolyUnion

Example(s)

Example 1

Create an union of polyhedra that holds two quadratic functions. Define Polyhedra
 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'

See Also

addfunction, removeallfunctions


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