As you have it, sum in the objective is the constant 0, so it is equivalent to not having an objective function.
Move sum =0 to after cvc_begin, and get rid of subject to
and move everything between that and cvx_end to before minimize.
I am not sure what you want to do with A. Is that what you are trying to optimize with respect to? if so, get rid of A = full(A) . That is overridden when A is declared a variable in CVX. I don;t know what you want to do with y, but it is not used in your CVX program.
You should use log_sum_exp.
If you do all of this, you might still not have the program you want. I suggest you re-read the CVX Users’ Guide and pay attention to the examples.
The subject to statement does nothing—CVX provides this statement simply to make specifications
more readable. As with indentation, it is optional.
I never use it. But for people who do, you can use it if you want. If you have no constraints, and you did not, subject to still does nothing, but might be confusing to someone looking at it - that is why I told you to get rid of it. But yes, you can keep it if you want. You can even have a bunch of them.