Based on your comment, I updated Ji= Ji + alpha*eye(N,N);
And only when alpha >= 1, the error disappears. Even for alpha= 1e-1 it remains. I think I’d re-write the problem somehow. In any case, I think it’s important to find another way to tunning how CVX considers a matrix to be undefined.
You only showed the result of eigs , which if run with default settings, displays the 6 largest magnitude eigenvalues.
Is N larger than 6? If so, perhaps you have significantly negative eigenvalue(s). What is the result of min(eig(J)) ? If that is about -1, then “updating” J by adding eye(N,N) is resulting in your solving a different problem than what you originally specified. If so, you need to rethink/reexamine your problem formulation.
I don’t know why you showed 6 eigenvalues for J when it is 4 by 4.
Nevertheless, your J is not symmetric. The CVX Users’ Guide says the 2nd argument of quad_form must be symmetric (among other things). It appears that CVX is accepting J + eye(4) in quad_form even though that is not symmetric - so that is a disparity between the CVX documentation and the code.