Extract function from PolyUnion object.
Un = U.getFunction(name)
Un = getFunction(U,name)
U |
Union of polyhedra in the same dimension. Class: PolyUnion |
name |
Name of the function to extract given as string. Class: string |
P = 5*ExamplePoly.randVrep;Triangulate the polyhedron
T = P.triangulate;Assign two functions to each polyhedron and give them names "a" and "b".
for i=1:numel(T), T(i).addFunction(AffFunction(randn(1,2)),'a'); T(i).addFunction(Function(@(x)norm(x,Inf)),'b'); endCreate the union of polyhedra by specifying some properties.
U = PolyUnion('Set',T,'convex',true,'overlaps',false,'fulldim',true,'bounded',true)
PolyUnion in the dimension 2 with 3 polyhedra. Properties of the union: Convex: 1 Overlaps: 0 Connected: 1 Bounded: 1 FullDim: 1 Functions : 2 attached "a", "b"Extract only function "b" from the union.
Un = U.getFunction('b')
PolyUnion in the dimension 2 with 3 polyhedra. Properties of the union: Convex: 1 Overlaps: 0 Connected: 1 Bounded: 1 FullDim: 1 Functions : 1 attached "b"We can plot the function over partition Un.
Un.fplot
◀ | removeallfunctions | isconvex | ▶ |
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch