Extract vector of decision variables from matrix variable values

```
decvec = mat2dec(lmisys,X1,X2,X3,...)
```

Given an LMI system `lmisys`

with matrix variables *X*_{1},
. . ., *X _{K}* and given values

`X1,...,Xk`

of `mat2dec`

returns
the corresponding value `decvec`

of the vector of
decision variables. Recall that the decision variables are the independent
entries of the matrices This function is useful, for example, to initialize the LMI
solvers `mincx`

or `gevp`

. Given an initial guess for *X*_{1},
. . ., *X _{K}*,

`mat2dec`

forms
the corresponding vector of decision variables `xinit`

.An error occurs if the dimensions and structure of `X1,...,Xk`

are
inconsistent with the description of *X*_{1},
. . ., *X _{K}* in

`lmisys`

.Consider an LMI system with two matrix variables *X* and *Y* such
that

*X*is a symmetric block diagonal with one 2-by-2 full block and one 2-by-2 scalar block.*Y*is a 2-by-3 rectangular matrix.

Particular instances of *X* and *Y* are

$${X}_{0}=\left(\begin{array}{cccc}1& 3& 0& 0\\ 3& -1& 0& 0\\ 0& 0& 5& 0\\ 0& 0& 0& 5\end{array}\right),\text{}{Y}_{0}=\left(\begin{array}{ccc}1& 2& 3\\ 4& 5& 6\end{array}\right)$$

and the corresponding vector of decision variables is given by

decv = mat2dec(lmisys,X0,Y0) decv' ans = 1 3 -1 5 1 2 3 4 5 6

Note that `decv`

is of length 10 since *Y* has
6 free entries while *X* has 4 independent entries
due to its structure. Use `decinfo`

to
obtain more information about the decision variable distribution in *X* and *Y*.

Was this topic helpful?