The index is beyond the matrix dimension

is whos immediately before the for loop? If so, all of your declared CVX variables and expressions should be shown, and listed as Class cvx But none of them are shown.

Edit: Let’s see the results of a properly executed whos. Either you made a mistake or you have encountered a CVX bug. CVX_SDP Index exceeds matrix dimensions problem