I have tried to solve the following problem. But CVX wouldnt accept the norm constraint

for i=1:10
cvx_begin sdp
variable sx(d)
subject to

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

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

This is not, in fact, convex. Nonlinear equality constraints rarely if ever are; and regardless, CVX does not accept them.

I have then tried norm(sx,2)<=0

it works. but this quantity has to be one for my case

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.