I need to create n variables \rho_i of dimension 2^i each. That is, \rho_1 of dimension 2, \rho_2 of dimension 4, and so on. Is there a sane way of doing this in CVX? I can’t use a ndarray as the variables have different dimensions. I can’t use cell arrays because CVX doesn’t support them.

I got it to work using the following hack:

`allrhos = cell(n,1);`

`for i=1:n`

`eval(sprintf('variable rho%d(2^%d,2^%d) hermitian;', i, i, i));`

`eval(sprintf('allrhos{%d} = rho%d;', i));`

`end`

But I really don’t want to use such horrific code. Is there a good way of doing this?