Plot function over the union of polyhedra.
h = Set.fplot()
h = Set.fplot('name', 'Prop1', value1, 'Prop2', value2)
h = fplot(Set, 'name', 'Prop1', value1, 'Prop2', value2)
U |
PolyUnion object that contains polyhedra in the same dimension with associated functions. Class: PolyUnion |
name |
If there are more functions over one set, the string name identifies
the function to be plotted. This argument can be omitted if only one function is attached to a set.
Class: char |
Prop1 |
Specification of figure properties. Class: char Allowed values:
|
value1 | Assigns value to Prop1. |
h |
Handle related to graphics object. Class: handle |
P(1) = Polyhedron('lb',-5,'ub',-1);
P(2) = Polyhedron('lb',-1,'ub',1);
P(3) = Polyhedron('lb',1,'ub',4);
P(4) = Polyhedron('lb',4,'ub',5);Add affine functions to these sets
P(1).addFunction(AffFunction(-2,1),'a');
P(2).addFunction(AffFunction(0.1,3.1),'a');
P(3).addFunction(AffFunction(-0.2,3.4),'a');
P(4).addFunction(AffFunction(2,-5.4),'a');Construct the union saying that it is convex, non-overlapping, bounded, and full-dimensional.
U = PolyUnion('Set',P,'convex',true,'overlaps',false,'bounded',true,'fulldim',true)
PolyUnion in the dimension 1 with 4 polyhedra. Properties of the union: Convex: 1 Overlaps: 0 Connected: 1 Bounded: 1 FullDim: 1 Functions : 1 attached "a"Plot the functions over the union with the line width equal 3 and by showing the polyhedra as well.
U.fplot('a','LineWidth',3,'show_set',true);
v = [-1, 1.7; 1.1, 0.5; 0, 2.3; 1, -1.7; 0, -2.3; -1.1 -0.5];
Q = Polyhedron(v);Triangulate the polygon and create an union of polyhedra.
T = PolyUnion('Set',Q.triangulate,'Convex',true,'overlaps',false)
PolyUnion in the dimension 2 with 4 polyhedra. Properties of the union: Convex: 1 Overlaps: 0 Connected: 1 Functions : noneAttach a quadratic function over this union and name it "power".
T.addFunction(QuadFunction(diag([1,2.3]),[-3,0.5],5),'power')
PolyUnion in the dimension 2 with 4 polyhedra. Properties of the union: Convex: 1 Overlaps: 0 Connected: 1 Functions : 1 attached "power"Plot the function over the union with random color, transparency equal 0.4, and show grid.
T.fplot('colororder','random','show_set',true,'alpha',0.4,'showgrid',true)
◀ | toc | isconnected | ▶ |
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch
© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk