sparse is used to create sdpvar objects with a certain structure.

```
x = sparse(i,j,s,n,m)
```

Creating a diagonal matrix with every second diagonal element zero can be done as

```
x = sparse(1:2:2*n,1:2:2*n,sdpvar(n,1))
```

The command works exactly as the normal sparse command. Hence, **help sparse** will give you the details.