A more permanent solution is to add the directory cvx/functions/vec_ to your MATLAB path (making sure of course to add the full path)!
Here’s what is going on. vec is a function that converts matrices into vectors. I have it privately defined for @cvx objects, so that definition doesn’t conflict with anything else. But it’s also useful for double-precision matrices as well. The problem is that a lot of other packages define it as well. In order to avoid name conflicts, I try to add my own version of vec.monly if it isn’t present already in your MATLAB path.
But for some reason, in a few cases out there, my cvx_setup script thinks it sees vec in your MATLAB path when it’s not there. I really don’t know why that is. I have simply been unable to reproduce this problem myself. If someone could figure that out for me, I would be grateful.
hi, my friend. I have a problem now hopeing you can help me:
Status: Failed
Optimal value (cvx_optval): NaN
this is my result using cvx. Now i want the result “NaN” as criterion. The objective function is
minimize(b’*x) where b=[0 0 0 1]. But when i ran the code “disp(num2str(x(4)));” the result is 619.4308. I don’t know why. Thank you!
OK, What i mean is that i want the solver’s state as a criterion. So i can decide what to do next. In my precedur, i get the objective value as the criterion. As you can see, the optimal value is NaN. For the outer layer, the criterion is
if isfinite(d)==0 % d is the solver’s result
disp(num2str(d));
break;
end
In addition, it displays 619.4308 in the console. I really don’t know why. Could tell me how can i get the state of the solver.
Thank you. I think i know why it displays 619.4308. In my code, i set b=[0 0 0 1] and minimize(b’*x). When cvx is over, it runs “d=b’*x” .but “x” is a intermediate result and not a correct result when cvx’s state is failed. and this is why i can’t get
correct objective value. So, i rewriting the code “d=cvx_optval”.