removeFunction

Purpose

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

Syntax

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

Description

Removes Function object from the union of convex sets identified by the string name. The functions stored with the union can be retrieved using listFunctions method. The name of the function must match with one of the names stored in the array.

Input Arguments

U

Object of the Union class that holds objects derived from the ConvexSet class.

Class: Union

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 pos as a cell array of strings.

Class: char

Output Arguments

U

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

Class: PolyUnion

Example(s)

Example 1

Create an union of two Yalmip sets that two functions. Define sets in 2D
 x = sdpvar(2,1); 

 F1 = [ [1, -2; 0.4, 5]*x<= [1;2]]; 

 F2 = [ [5, -3; 1.3, -2; 0.8 -9; 1 -0.3]*x<= [1;2;1;1.5]]; 

 Y(1) = YSet(x,F1); 

 Y(2) = YSet(x,F2); 
 Define the functions
 f1 = AffFunction([0.1,-3],2); 

 f2 = AffFunction([-2,0.5],0.4);
 Add these functions to the sets
 Y.addFunction(f1,'f1'); 

 Y.addFunction(f2,'f2'); 
 Create the Union object. 
 U = Union(Y) 
Union of 2 convex sets.
Functions : 2 attached "f1", "f2"
Remove the function "f2" from the set
 U.removeFunction('f2') 
Union of 2 convex sets.
Functions : 1 attached "f1"
Union of sets now contains only 'f1' function
 U.listFunctions 
ans = 

    'f1'

See Also

addfunction, removeallfunctions


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