


MPT_PLOTPWQ Plots a PWQ function defined over polyhedral partition
handle = mpt_plotPWQ(Pn,Q,L,C,meshgridpoints,Options);
---------------------------------------------------------------------------
DESCRIPTION
---------------------------------------------------------------------------
Plots a PWQ function defined over a given polyhedral partition.
PWQ = x'Qx + Lx + C.
This function could be used either to plot PWQ Lyapunov function
obtained by mpt_getPWQLyapFct or to plot the piece-wise quadratic
cost function of an explicit solution
USAGE:
mpt_plotPWQ(Pn,Ai,Bi,Ci) to plot PWQ function over Pn
NOTE:
If Pn contains overlapping regions, this function will only plot the lowest
value associated to given points.
---------------------------------------------------------------------------
INPUT
---------------------------------------------------------------------------
Pn - Polyhedral partition given by the polytope array Pn
Q,L,C - Cells containing parameters of the PWQ function x'Qx+x'L+C
meshgridpoints - number of grid points in one axis,
(default: 30)
Options.drawnow - Whether or not to use the drawnow command to refresh the
current plot (default is true)
Options.shade - Level of transparency (0 = fully transparent, 1 = solid)
Options.edgecolor - specifies the color of edges. Default: 'k'.
Options.edgewidth - specifies the width of edges. Default: 0.5.
Options.lpsolver - Solver for LPs when (and if) computing bounding box of Pn,
(default: mptOptions.lpsolver)
Options.newfigure - If set to 1, opens a new figure window,
(default: mptOptions.newfigure)
Options.showPn - If set to 1, plots on polyhedral sets Pn,
(default: 1)
Options.samecolors - If set to 1, pieces of PWA function will be plotted
in the same colors as the partition below
(default: 0)
Options.min_x1 - Rectangular space where PWQ function is computed
(default: bounding box on Pn)
Options.max_x1 - Rectangular space where PWQ function is computed
(default: bounding box on Pn)
Options.min_x2 - Rectangular space where PWQ function is computed
(default: bounding box on Pn)
Options.max_x2 - Rectangular space where PWQ function is computed
(default: bounding box on Pn)
Note: If Options is missing or some of the fields are not defined, the default
values from mptOptions will be used
---------------------------------------------------------------------------
OUTPUT
---------------------------------------------------------------------------
handle.PWQ - handle of the PWQ function
handle.Pn - handle of the plotted partition
see also MPT_PLOTPWA, MPT_PLOTJ