# Invalid quadratic form(s): not a square. Thanks

#1

I got some problems when I try to implement the following formula. I want to get some help and I will appreciate it.

My problem is mainly about the formula which is related to a(i) and t(i). I do not know how to implement that.

This is my code.

Blockquote
cvx_begin

``````variable w(n*L) complex
variable t(n)
variable a(n)
expression reweight(n)

for i = 1:n
reweight(i) = a(i) * t(i);
end

minimize(sum(reweight));

subject to

Atar(:,:,f_ref)*w == 1 ;   % norm(Pr - w'*S) <= alpha
abs(As(:,:,f_ref)*w) <= deta

abs(U.^(1/2)*V'*w) <= detae;%norm(L'*w) <= cigma

for i = 1:n
a(i)*norm(w((i-1)*L+1:i*L))<=t(i);
end
``````

cvx_end

Blockquote

Thank you for help.

(Mark L. Stone) #2

I’m not sure whether
`t`
should be a CVX variable or is input data, but I’m fairly sure
`a`
should not be a CVX variable…

You need to think very clearly about what is input data to the optimization problem, and what are optimiation (decision) variables.

#3

Thank you for your help. The problems was solved. As you say ,
a
is not a CVX variable and
t
is.
But I have another question. How can I implement the CVX variable
w
which include a CVX variable
t?

(Mark L. Stone) #4

Form as a CVX expression.

For instance,

variables w(4) t
wstar = [t;w]

wstar is cvx real affine expression (5x1 vector)

Is this the kind of thing you want to do?