Home > mpt > @polytope > isinside.m

# isinside

## PURPOSE

ISINSIDE Checks if a given point lies in the interior of a given polytope

## SYNOPSIS

function [isin, inwhich, closest] = isinside(P,x0,Options)

## DESCRIPTION

```ISINSIDE Checks if a given point lies in the interior of a given polytope

[isin, inwhich, closest] = isinside(P,x0,Options)

---------------------------------------------------------------------------
DESCRIPTION
---------------------------------------------------------------------------
Checks if the given point x0 lies in the interior of the polytope P

---------------------------------------------------------------------------
INPUT
---------------------------------------------------------------------------
P                 - Polytopes
x0                - given point, if not specified: Options.clickx0=1
Options.abs_tol   - absolute tolerance
Options.fastbreak - if set to 1 and P is a polyarray, returns only the first
element of P in which x0 lies in
Options.clickx0   - find the region by clicking in the plot
Options.newfigure - if a new figure for clicking is desired (default = 1)

Note: If Options is missing or some of the fields are not defined, the default
values from mptOptions will be used

---------------------------------------------------------------------------
OUTPUT
---------------------------------------------------------------------------
isin      - logical statement indicating if P.H*x0<=P.K was satisfied
inwhich   - indices of polytopes in P (if P is an array of polytopes) in which
the points lies [i.e. P(inwhich) will return all elements of P which
contain the given point x0]
closest   - if the point does not belong to P, index of the polytope which is
closest to the point x is returned

## CROSS-REFERENCE INFORMATION

This function calls:
• length LENGTH Returns number of regions over which the explicit control law is defined
• plot PLOT Plots regions of the explicit controller
• dimension DIMENSION Returns dimension of the given polytope
• end END Returns the last element in a given polytope array
• isfulldim ISFULLDIM Checks if a polytope is full dimensional
• isinside ISINSIDE Checks if a given point lies in the interior of a given polytope
• length LENGTH Returns number of elements in a polytope array
• normalize NORMALIZE Normalizes a given polytope
• plot PLOT Plots polytopes in 2D or 3D
• size SIZE Returns size of the given polytope object
This function is called by:
• analyticCenter ANALYTICCENTER Computes an analytic center of a polytope
• isinside ISINSIDE Checks if a given point lies in the interior of a given polytope
• projection PROJECTION Projection of a polytope or a polytope array
• triangulate TRIANGULATE Calculates triangulation of arbitrary polytopes
• mpt_getCommonSOSLyapFct MPT_GETCOMMONSOSLYAPFCT Calculates Common SOS Lyapunov function for system with additive disturbance
• mpt_getPWALyapFct MPT_GETPWALYAPFCT Calculates PWA Lyapunov function
• mpt_getPWPLyapFct MPT_GETPWPLYAPFCT Calculates Piecewise Polynomial (sum of squares) Lyapunov function
• mpt_getPWQLyapFct MPT_GETPWQLYAPFCT Calculates PWQ Lyapunov function
• mpt_getReachSubset MPT_GETREACHSUBSET Computes a subset of P which enters Pfin
• mpt_isPWAbigger MPT_ISPWABIGGER Test if one PWA function is bigger than a second PWA function
• mpt_evalPWA MPT_EVALPWA Evaluates a PWA function at a given location
• mpt_feasibleStates MPT_FEASIBLESTATES returns equidistantly spaced data points in feasible set
• mpt_getOptimizer MPT_GETOPTIMIZER For a given state, extracts the optimizer obtained by a multi-parametric solver
• mpt_mplp_ver1 MPT_MPLP Explicitly solves the given linear program (LP)
• mpt_mplp_ver2 MPT_MPLP Explicitly solves the given linear program (LP)
• mpt_mplp_ver3 MPT_MPLP Explicitly solves the given linear program (LP)
• mpt_mplp_ver4 MPT_MPLP Explicitly solves the given linear program (LP)
• mpt_mplp_ver5 MPT_MPLP Explicitly solves the given linear program (LP)
• mpt_mplp_ver6 MPT_MPLP Explicitly solves the given linear program (LP)
• mpt_mplp_ver7 MPT_MPLP Explicitly solves the given linear program (LP)
• mpt_performance MPT_PERFORMANCE Computes performance (i.e. sum of closed-loop costs) associated to a given controller
• sub_computeTrajectory sub_COMPUTETRAJECTORY Calculates time evolution of state trajectories subject to control
• mpt_getInputXU MPT_GETINPUTXU For a given state, extracts the an output from an XUset
• mpt_optInfControl MPT_OPTINFCONTROL Solves the infinite-time constrained optimal control problem for LTI systems
• mpt_optInfControlPWA MPT_OPTINFCONTROLPWA Solves the infinite-time constrained optimal control problem for PWA systems