given x and y data points, I am trying to minimize the function shown in the image, but getting below error.
(upload://b29lLLjHTD1n7ohfGb90PIDqub4.jpeg)

Disciplined convex programming error:
Only scalar quadratic forms can be specified in CVX ![cvxprob1|344x84]

I can’t see the image, so I don’t know what problem you are trying to solve.

Is the problem (objective function in this case) convex? if it is, you must follow CVX’s rules. A*z does not follow CVX’s rule (CVX can not determine ti to be convex or concave), and even if it did, it is nonlinear, and therefore invalid as an argument to norm.

Also, z, A should not be declared as variables, because they are expressions built up from CVX variables. b should not be declared as a variable, because it apparently is just a constant (presuming x and y are constants).

It seems apparent you need to read or re-read the CVX Users’ Guide.

The -r^2 looks rather fishy relative to convexity, even if you use a variable r_squared. Have you proven convexity? I will mark this as non-convex unless you show otherwise.