This is a syntax question. I am trying to construct a constraint ensuring sum(A*x) is PSD while minimizing x
In the following code I am adding each term of the summation manually (6 in this case but may be a lot more), it solves with no problem. None of the loops I tried work, is it possible to construct the matrix first including the variables, then set the >=0 constraint? If so, how?
Also, how do I set a constraint ensuring each item of the X array is greater than or equal to 0 in the SDP mode? The constraint I put in (commented out below) results in an error.
cvx_begin sdp variables X(6) minimize(sum(X)) subject to A(:,:,1).*X(1)+... A(:,:,2).*X(2)+... A(:,:,3).*X(3)+... A(:,:,4).*X(4)+... A(:,:,5).*X(5)+... A(:,:,6).*X(6)>=0 % X>0 cvx_end
A matrix is here: link
Thank you so much for reading!