Saving solver status in a variable

Hello,

when I run CVX to solve SDPs with SDP solver SDPT3, how do I save the solver status in a variable?

I would like to write a script as

for i=1:50

solve an SDP with CVX
if the solver status is 1, increment counter1
if the solver status is 2, increment counter2

end

same question for MOSEK

Thank you

Use strncmpi on cvx_status … You can save cvx_status to a variable if you wish, but if you just want to do some “test” on it (as in your example) prior to the next invocation of CVX, that’s not necessary.

1 Like