How to express LMI constraint in my CVX model?

Hi dear friends, after reading the “SDP” part and “Set membership part” of CVX guide. I still have some confusions about how to express a Linear Matrix Inequality constraint which the elements of the matrix contains cvx variables in a SDP problem.
There is my problem and corresponding Matlab code.
The LMI constraint is:

and there is the code:

cvx_begin sdp

subject to

for n=1:N
% =====LMI constraint======
[chi(n)-1,0,q_x(n)-w_e(1);0,chi(n)-1,q_y(n)-w_e(2);q_x(n)-w_e(1),q_y(n)-w_e(2),psi_2-chi(n)*r_E^2] >= 0
end
cvx_end

But cvx tell me that it is a Unbounded problem.

Trivial infeasibilities detected; solution determined analytically.
Status: Unbounded
Optimal value (cvx_optval): +Inf

I’m trying to use this LMI constraint to make my optimization problem bounded, It looks like this constraint didn’t work. I guess there’s something wrong with the way I express LMI constraint. So I change the way to express LMI:

cvx_begin sdp

variable  X(3,3,N)  symmetric

subject to

%====new way to express LMI =====
X(1,1,n) == chi(n)-1
X(1,2,n) == 0
X(1,3,n) == q_x(n)-w_e(1)
X(2,1,n) == 0
X(2,2,n) == chi(n)-1
X(2,3,n) == q_y(n)-w_e(2)
X(3,1,n) == q_x(n)-w_e(1)
X(3,2,n) == q_y(n)-w_e(2)
X(3,3,n) == psi_2-chi(n)*r_E^2
X(:,:,n) == semidefinite(3)
    


cvx_end

But cvx give me some error message:

error cvxprob/eliminate (line 137)
P = P * cvx_invert_structure( xR );

error cvxprob/solve (line 18)
[ At, cones, sgn, Q, P, dualized ] = eliminate( prob, true, shim.dualize );

error cvx_end (line 88)
solve( prob );

error Untitled (line 94)
cvx_end

I have did my best to debug the code, but it’s meaningless, So could someone can tell me the correct way to express LMI constraint and how to make the LMI constraint work or be able to point out other wrong place in my code?Very grateful for your help!

When I ran the 2nd version of your program, I received the following error message after cvx_end, so perhaps indicative of a bug in CVX.

Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To
perform elementwise multiplication, use ‘.*’.
Error in cvxprob/eliminate (line 137)
P = P * cvx_invert_structure( xR );
Error in cvxprob/solve (line 18)
[ At, cones, sgn, Q, P, dualized ] = eliminate( prob, true, shim.dualize );
Error in cvx_end (line 88)
solve( prob );

As for the 1st version, it is a complicated program which you are in the best position to understand. There is a lot more going on than just LMI constraints. I suggest you follow the suggestions at https://yalmip.github.io/debuggingunbounded . I won’t rule out that your program might have fallen victim to a bug which does not produce an obvious error message, but might result in incorrect answer.