Consider the following simple SDP program.

```
n=2;
t=rand(2*n,2*n);
mat=(t+t')/2;
cvx_begin SDP
variable X1(n,n) hermitian semidefinite
variable X2(n,n) hermitian semidefinite
minimize( trace(X1) + trace(X2) )
subject to
k = trace(X1) + trace(X2);
blkdiag( k*eye(n) + X1, X2 ) >= mat
cvx_end
```

This causes the following error:

```
Error using reshape
To RESHAPE the number of elements must not change.
Error in cvx_reshape (line 52)
x = reshape( x, s );
Error in cvx/cvx_readlevel (line 7)
y = cvx_reshape( y, x.size_ );
Error in cvxprob/newcnstr (line 94)
tx = cvx_readlevel( x );
Error in >= (line 21)
b = newcnstr( evalin( 'caller', 'cvx_problem', '[]' ), x, y, '>=' );
Error in cvxtest (line 12)
blkdiag(k*eye(n)+X1,X2)>=mat
```

Rewriting `blkdiag(k*eye(n)+X1,X2)>=mat`

as `mat-blkdiag(k*eye(n)+X1,X2)<=0`

changes the error to:

```
Matrix dimensions must agree.
Error in + (line 73)
bad = vx + size( remap_plus, 1 ) * ( vy - 1 );
Error in - (line 21)
z = plus( x, y, true, cheat );
Error in cvxtest (line 14)
mat-blkdiag(k*eye(n)+X1,X2)<=0
```

The matrix dimensions obviously agree, so I am not sure what can be wrong. I would appreciate any help because I keep running into this problem in my code.

I am using CVX 2.1 in Matlab 2016b.