just like this problem, how to write it in cvx?
You can initiate a Cost Function(myJ) before the CVX Loop as
myJ = [ ];
Then, in CVX you can use the following Quadratic Cost(as an example) Function that sums from 1 to N;
for ix = 1 : N
myJ = myJ + X(:,ix)'QX(:,ix) %Sum Symbol Cost function construction
Hope it helps
Thank you for your answer, it really helps.
Because my result isn’t right, so I can’t sure if I write my subject like that is true, could you give me some advice?
variables x11(N) x12(N) u11(N) u12(N) y1(N)
OK, I have solved it, thank u so much.
iskender9961 's proposed solution which includes
myJ = ;
would result in an empty objective, and therefore CVX would be solving a feasibility problem, i.e., returning any feasible solution.
I see in your solution you used
obj1 = 0
instead, i.e., initializing to 0 rather than . So you have done that the right way. I haven’t checked the correctness of the rest of what you’ve done.