Implementing N norm inequality / second-order cone constraints

I am new to CVX and want to implement the following constraint:

\|E_a S_k \mathbf{x} \| \leq \mathbf{e}_b^T S_k \mathbf{x},\quad k=0,1,...,N

where

  • \mathbf{x} is the decision vector that contains N control vectors stacked on top of one another, \mathbf{x} = (\begin{matrix} \mathbf{x}_1^T & \mathbf{x}_2^T & \cdots & \mathbf{x}_N^T \end{matrix})^T, \mathbf{x}_k \in \mathbb{R}^4,
  • the matrix S_k “selects” one of these vectors at step k for evaluating the constraint, as in S_k = [\begin{matrix} 0 & \cdots & 0 & I & 0 \cdots & 0 \end{matrix}],
  • and the matrix E_a and the vector \mathbf{e}_b again select sub-elements of the vectors \mathbf{x}_k for comparison in the inequality. In this case E_a = [\begin{matrix} I_{3\times 3} 0_{3\times1} \end{matrix}] and \mathbf{e}_b = (\begin{matrix} 0 & 0 & 0 & 1 \end{matrix})^T select the from \mathbf{x}_k = (\begin{matrix} \mathbf{a}_k^T & b_k \end{matrix})^T.

I cannot wrap my head around how I can easily implement this in CVX. One option would be to type in each constraint individually, but that seems to be excessive work for large N.

Can I somehow make this dynamic, so that I can specify N and CVX automatically generates the constraints and S_k appropriately?

Any reason a for loop won’t work?

Can I just use a for loop in cvx_begin … cvx_end? If yes, can you give point me to an example where something like that is applied?

Sure, this example uses one. Of course, the for loop variable can’t also be a CVX variable, but I don’t think that will be a problem.