Hi guys, I am new in matlab and cvx and need your help. I went through the cvx guide and tried to come up with the matlab code for this optimization problem.
I am trying to code the convex optimization problem below using cvx and I’m getting an error when using “alpha” as a variable.
Tried to use “X” as a variable and had a different error. Should I have to use a different syntax? Please advise.
#Code using “alpha” as variable:
variable alpha(n,n) symetric
sum(alpha*P(:,j)) <= P_bar
0.7283 -1.3573 2.1122 -1.0226
Error using variable (line 100)
Variable name “alpha” is the name of an existing MATLAB function or directory:
Please choose a different name.
#Code using “X” as variable:
variables X(n,n) symetric
sum(X*P(:,j)) <= P_bar
Error using cvx_end (line 267)
Your objective function is not a scalar.