# lmivar

Specify matrix variables in LMI problem

## Syntax

X = lmivar(type,struct) [X,n,sX] = lmivar(type,struct)

## Description

`lmivar`

defines a new matrix
variable *X* in the LMI system currently described.
The optional output `X`

is an identifier that can
be used for subsequent reference to this new variable.

The first argument `type`

selects among available
types of variables and the second argument `struct`

gives
further information on the structure of *X* depending
on its type. Available variable types include:

**type=1:** Symmetric matrices
with a block-diagonal structure. Each diagonal block is either full
(arbitrary symmetric matrix), scalar (a multiple of the identity matrix),
or identically zero.

If *X* has *R* diagonal blocks, `struct`

is
an *R*-by-2 matrix where

`struct(r,1)`

is the size of the*r*-th block`struct(r,2)`

is the type of the*r*-th block (1 for full, 0 for scalar, –1 for zero block).

**type=2:** Full *m*-by-*n* rectangular
matrix. Set `struct = [m,n]`

in this case.

**type=3:** Other structures. With
Type 3, each entry of *X* is specified as zero or
±*x* where *x _{n}* is
the

*n*-th decision variable.

Accordingly, `struct`

is a matrix of the same
dimensions as *X* such that

`struct(i,j)=0`

if*X*(*i, j*) is a hard zero`struct(i,j)=n`

if*X*(*i, j*) =*x*_{n}`struct(i,j)=–n`

if*X*(*i, j*) = –*x*_{n}

Sophisticated matrix variable structures can be defined with
Type 3. To specify a variable *X* of Type 3, first
identify how many *free independent entries* are
involved in *X*. These constitute the set of decision
variables associated with *X*. If the problem already
involves *n* decision variables, label the new free
variables as *x _{n}*

_{+1}, . . .,

*x*. The structure of

_{n+p}*X*is then defined in terms of

*x*

_{n}_{+1}, . . .,

*x*as indicated above. To help specify matrix variables of Type 3,

_{n+p}`lmivar`

optionally
returns two extra outputs: (1) the total number n of scalar decision
variables used so far and (2) a matrix `sX`

showing
the entry-wise dependence of *X*on the decision variables

*x*

_{1}, . . .,

*x*.

_{n}## Examples

**Introduced before R2006a**