So why doesn't the sum function work? Which one should I use?

image

image

Please show MATLAB/CVX code together with the corresponding error message. Lines 1-3 of the code are pure MATLAB and have nothing to do with CVX. But the error message you show clearly does involve CVX. And what is wayul? it looks like the result of magic(3).