Disciplined covex programming error while using norm()

I am trying to write my objective function, given below:

using norms like this:

minimize {10 * norm(y-y_ref) ^2 + norm(u) ^2 }

So that I dont have to use for loop. But I am getting error. Any idea whats wrong here?

Either use sum_square(u) or square_pos(norm(u)) . Similarly for the other term.

CVX 3.0 beta allows constructs like norm(x)^2, but not CVX 2.1. Still, there have been some reports of remaining issues with 3.0 so I think you’re best bet is to take Mark’s advice.