Multiple matrix variables definition

(Hyungjin Choi) #1

When using CVX, we define multiple 1-dimensional variables a1,a2,…,a(n) by “variables a(n)”. I wonder how we do the same thing for 2 or higher-dimensional variables such as multiple 2 by 2 matrices. I tried:
for k = 1 : N
variable X(3,3,k) symmetric
It gave me error that multiple definition for X. Please feel free for any opinions.

(Mark L. Stone) #2

Don;t use a for loop.

See the answer by mcg at Semidefinite relaxations of quadratic constraint