I wrote a simple piece of cvx code.
cvx_setpath cvx_clear cvx_begin variable x(n); variable z(n); variable w(n); expression s; s=x.*yapp+z-w; expression alk; expression hrk; alk = x'*A*x; %A and B are positive semidefinite matrices hrk = s'*B*s; minimize (1/(2*lambda)*alk+1/(2*lambda_o)*hrk-ONESn'*x) subject to x >=0 z >=0 w >=0 x <= 1/n z+w==u+v*ONESn; cvx_end
But unfortunately, this code produces the following error
Undefined function or variable 'x'. Error in twofuncsvm (line 19) s=x.*yapp+z-w;
When I change the variable name to some other thing say u, for the first time the error is about other variables like z or w and after some times again the error is about u .
What is the problem, what I’m doing wrong?
Any help is appreciated. I don’t know what to do.