You haven’t told us what a1 and a2 are. I will presume they are non-negative constants and ignore them for the time being. Your objective as written is not a scalar, so it can not be a valid objective function. It’s also not clear to me how many times you want the components of x to be in effect squared. As written, you are getting something like x^4. Bottom line: I don’t know what problem you are trying to solve.
Is this what you want?
If x is intended to be complex, you need to declare it as such
variable x(n,1) complex