fplot

Purpose

Plot single function over the sets of the Union object.

Syntax

h = Set.fplot()
h = Set.fplot('name', 'Prop1', value1, 'Prop2', value2)
h = fplot(Set, 'name', 'Prop1', value1, 'Prop2', value2)

Description

Plot single function over an union of convex sets. If there are more functions attached to a set, then the string name identifies the function to be plotted. If the function is vector valued, i.e. its range is greater than 1, than the first element of the function is plotted by default. For vector valued functions, use the position property to indicate that you want a different element of the function value to plot. Figure properties, such as color, line width, etc, can be specified with "Property" - "Value" pairs.

Input Arguments

U

Union object that contains sets derived from the ConvexSet class, e.g. Polyhedron, YSet, ...

Class: Union

name

If there are more functions attached to the set, this string indicates the name of the function to plot.

Class: char

Prop1

Specification of figure properties.

Class: char

Allowed values:

  • position

    For vector valued functions, the position indicates which element of the function value to plot.
  • Grid

    With how many gridpoints to grid the circle/sphere. Default is 20.
  • Color

    The color of the plot specified by real RGB vector or a string name of the color (e.g. 'gray');
  • Wire

    Highlight the edges of the set. Default is false.
  • LineStyle

    Specify the type of the line to plot edges of the set. Accepted values are '-',':','-.','--', and'none'.
  • LineWidth

    Specify the width of the line. Default is 1.
  • Alpha

    Transparency of the color. The value must be inside [0,1] interval. Default is 1.
  • Contour

    Add contour graph. Default is false.
  • ContourGrid

    With how many grid points to plot the contour graph. Default is 30.
  • show_set

    Plot the domain of the function. Default is false.
  • showgrid

    Show the grid inside the set. Default is false.
  • colormap

    Color map to use given as a string or a function handle. Default is 'mpt'.
  • colororder

    Either 'fixed' or 'random'. Default is 'fixed'.

value1

Assigns value to Prop1.

Output Arguments

h

Handle related to graphics object.

Class: handle

Example(s)

Example 1

We have two linear functions "alpha", "beta" over a union of convex sets. Construct the set first set as the circle
 x = sdpvar(2,1); 

 F = [0.5*x'*x<=0.2]; 

 S = YSet(x,F); 
 Construct quadratic and linear function.
 Q = QuadFunction(eye(2),[0,1]); 

 L = AffFunction([-3, 1], 1); 
 Add functions to the set with names "alpha" and "beta". 
 S.addFunction(Q,'alpha'); 

 S.addFunction(L,'beta'); 
 Construct a hyperplane that separates the set S and the point x=[0;1]. 
 x = [0;1]; h = S.separate(x); 
 Construct a polyhedron out of the hyperplane. 
 P = Polyhedron('He',h,'lb',[-1;-1],'ub',[1;1]); 
 Add functions "alpha" and "beta" to the polyhedron 
 P.addFunction(Q,'alpha'); 

 P.addFunction(L,'beta'); 
 Create union object from the sets S and P. 
 U = Union(S); U.add(P) 
Union of 2 convex sets.
Functions : 2 attached "alpha", "beta"
Plot the function "beta" over the union because this is contained in both sets
 U.fplot('beta'); 

../../../../../../fig/mpt/modules/geometry/unions/@Union/fplot_img_1.png

See Also

plot


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

© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk