removeFunction

Purpose

Remove function associated to a convex set based on the function name.

Syntax

Set = removeFunction(Set,name)
Set.removeFunction(name)

Description

Removes the Function object F from the convex Set identified by the string name. The functions stored with the set can be found under Func property. The function name must match one of function names stored under this set that can be retrieved using listFunctions method.

Input Arguments

Set

Any object derived from the ConvexSet class, e.g. Polyhedron, YSet, ...

Class: ConvexSet

name

Name of the function to remove from the array. String must match one of the stored function names. For multiple names, specify name as a cell array of strings.

Class: double or char

Output Arguments

Set

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

Class: ConvexSet

Example(s)

Example 1

Add two functions ../../../../../../fig/mpt/modules/geometry/sets/@ConvexSet/removefunction1.png and ../../../../../../fig/mpt/modules/geometry/sets/@ConvexSet/removefunction2.png to a polyhedron ../../../../../../fig/mpt/modules/geometry/sets/@ConvexSet/removefunction3.png Define Polyhedron
 P = Polyhedron('lb',-4,'ub',5); 
 Define the functions
 f1 = AffFunction(-1,1); f2=AffFunction(1,2);
 Add these functions to the polyhedron  
 P.addFunction(f1, 'f1');

 P.addFunction(f2, 'f2');
 Remove the function "f1" from the set 
 P.removeFunction('f1') 
Polyhedron in R^1 with representations:
    H-rep (redundant)   : Inequalities   2 | Equalities   0
    V-rep               : Unknown (call computeVRep() to compute)
Functions : 1 attached "f2"
Polyhedron no contains only 'f2' function
 P.Func 
ans = 

    [1x1 AffFunction]

See Also

convexset, function, quadfunction, afffunction, addfunction


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