Undefined matrix structure type: Cc_a(1) Trying to declare multiple variables? Use the VARIABLES keyword instead

Uncategorized
Dec 6, 2022
K

information:
SDPT3 Version 2.2 Except for variables, everything else is constant
error:
Undefined matrix structure type: q(3)
Trying to declare multiple variables? Use the VARIABLES keyword instead.
%*****************************code follows
cvx_begin
variable Cc_a q(3)

maximize(-Cc_a);

subject to

Cc_a>=log(1+norm(Lp0)^(2)/ (norm(Lp1)^(2)+norm(Lp2)^(2)+rnorm(q0-ue)^(2) ))-(norm(Lp0)^(2))(-(q0-ue)’(q0-ue)+2(q0-ue)’(q-ue)-norm(q0-ue)^(2))/(norm(Lp0)^(2)+norm(Lp1)^(2)+norm(Lp2)^(2)+rnorm(q0-ue)^(2))/(norm(Lp1)^(2)+norm(Lp2)^(2)+rnorm(q0-ue)^(2) );
q<=qmax;
q>=qmin;

cvx_end

M

Do what the error message says:
variables Cc_a q(3)

http://cvxr.com/cvx/doc/basics.html#variables

As flexible as the variable statement may be, it can only be used to declare a single variable, which can be inconvenient if you have a lot of variables to declare. For this reason, the variables statement is provided which allows you to declare multiple variables; i.e.,

variables x1 x2 x3 y1(10) y2(10,10,10);

The one limitation of the variables command is that it cannot declare complex, integer, or structured variables. These must be declared one at a time, using the singular variable command.

K
Replying to #2

error use variable
Undefined matrix structure type: q(3)
Trying to declare multiple variables? Use the VARIABLES keyword instead.

M

I just showed you what to do, and provided the relevant extract from the CVX Users’ Guide.

K
Replying to #4

This problem has been bothering me for two days, but it has finally been solved. Thank you very much for solving my confusion.