# symdec

Form symmetric matrix

## Syntax

```x = symdec(m,n)
```

## Description

`symdec(m,n)` forms an m-by-m symmetric matrix of the form

`$\left[\begin{array}{cccc}\left(n+1\right)& \left(n+2\right)& \left(n+4\right)& \dots \\ \left(n+2\right)& \left(n+3\right)& \left(n+5\right)& \dots \\ \left(n+4\right)& \left(n+5\right)& \left(n+6\right)& \dots \\ \dots & \dots & \dots & \dots \\ \dots & \dots & \dots & \dots \end{array}\right]$`

This function is useful to define symmetric matrix variables. `n` is the number of decision variables.

## Examples

collapse all

Create a 4-by-4 symmetric matrix for an LMI problem in which n = 2. Display the matrix to verify its form.

`X = symdec(4,2)`
```X = 4×4 3 4 6 9 4 5 7 10 6 7 8 11 9 10 11 12 ```