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?
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?