Error: Function 'subsindex' is not defined for values of class 'cvx'

Hi,

I had this error when I tried cvx.

cvx_begin
variable s(N,1)
minimize( norm( Ws,1 )+gama((norm(deltax.Ds,2)^2)+(norm(deltay.Ds ,2)^2) ))
subject to
( norm( A*s-b, 2 ))^2/(norm(b,2)^2) <= e
cvx_end

You have not provided reproducible code, so the following comments may not be comprehensive.

The squaring of the norm oould only be “legal” in CVX 3.0beta, which is full of bugs, so I recommend you don’t use it.

In CVX 2.2, you need to use square_pos rather than ^2 to square a positive convex expression, such as norm(...).

I have no idea what gama does, but it might be something illegal in CVX.

Thanks for your answer. I still have the same error. Sorry I’m new at cvx.
D:NxN 2d dct transform matrix, A:MxN matrix, b=As ,s:Nx1 ,W:NxN matrix

cvx_begin
    variable s(N,1)
    minimize( norm( W*s,1 )+(square_pos(norm(0.3.*D*s,2))+square_pos(norm(0.3.*D*s ,2)) ))
    subject to
       ( square_pos (norm( A*s-b, 2 ))/square_pos((norm(b,2)))) <= e
cvx_end

I don’t know what D is (Discrete Cosine Transform doesn’t tell me what it is from object type standpoint), and whether that’s causing the error. Is it a matrix of double precision numbers? if so, it should be alright. If it is some special type of object other than double precision matrix, that probably will cause an error.

If the error is not due to D
Try a new MATLAB session. If that doesn’t work, try reinstalling CVX 2.2 in a new MATLAB session, then run the problem.