for i=1:10
cvx_begin sdp
variable sx(d)
minimize(sx’*sigma{1,i}*sx)
subject to
norm(sx,2)==1
ones(1,d)abs(sxsx’)ones(d,1)<=10
sxsx’>=0
cvx_end
s(:,i+1)=sx;
q(:,i+1)=delta{1,i}*s(:,i+1)’;
sigma{1,i+1}=(eye(d)-q(:,i+1)*q(:,i+1)’)sigma{1,i}(eye(d)-q(:,i+1)q(:,i+1)’);
delta{1,i+1}=delta{1,i}(eye(d)-q(:,i+1)*q(:,i+1)’);
s(:,i+1)=s(:,i)/norm(s(:,i+1));
end

The error message i have got is
??? Error using ==> cvxprob.newcnstr at 192
Disciplined convex programming error:
Invalid constraint: {convex} == {real constant}

Error in ==> cvx.eq at 12
b = newcnstr( evalin( ‘caller’, ‘cvx_problem’, ‘[]’ ), x, y, ‘==’ );

Error in ==> matlabcode at 69
norm(sx,2)==1

If i am not mistaken. The l2 norm is convex. Could anyone please help me with this problem?

You could try norm(sx,2) <= 1; if the optimal solution satisfies norm(sx,2) == 1, then that solution is optimal for your actual problem with norm(sx,2) constrained to 1.

Otherwise you could try the convex-concave optimization procedure, with all its caveats, described in stephen_boyd’s answer in How to handle nonlinear equality constraints? to handle a constraint norm(sx,2) >=1. You could combine this with the CVX-compliant constraint norm(sx,2) <= 1. I don’t know whether this will converge, and if so to a local minimum, but you lose any guarantee of global optimality, and how well the procedure works and what local optimal solution it produces may depend on the starting value used in the convex-concave optimization procedure. Note that this is different than the scenario described by stephen_boyd, since he addressed a “wrong-way” inequality, i.e., norm(sx,2) >= 1, not combining that with norm(sx,2) <= 1 to try to force norm(sx,2) == 1.