Error in maximize (line 21)
newobj( prob, ‘maximize’, x );
That tells you exactly what CVX objects to. If you minimize instead of maximize, CVX will accept the problem, and the solver it calls will solve it. If you really wish to maximize a convex quadratic objective function, that is a non-convex problem which CVX will not accept, and you will need to use some other tool to solve it.