Why use function '' sum'' in CVX, the output indicate that :The function 'subsindex' is not defined for the value of class 'cvx'

matlab code as follow:

I will address

The left hand-side is a CVX expression. You are attempting to assign a numerical value, B0, to that expression, which is not allowed. I am guessing that you intended this to be a constraint, in which case you need to use == , not = , and that is allowed.

I am offering no opinion as to whether there are any other problems with your code.

In the future, instead of including images of CVX code, please copy and paste CVX code into forum questions and use Performatted text or quote. That way, people trying to answer your question can copy and paste into their own MATLAB session.

hello ,Mark_L_Stone, use ‘==’ work well ,thanks very much ! your suggestion i will accept using Performatted text or quote instead of including images of CVX code.

1 Like