# Is there a way to print only the result (without any diagnosis)?

Before asking, let me show my pseudocode (as known as difference of convex (DC) programming):

``````K = 10;                        // given parameter
Pmax = 10;                 // given parameter
Pmax_each = 1.3*ones(K,1);        // given parameter

P_prev = Pmax/K*ones(K,1);        // Initialize P (which is the variable that I want to optimize.)
fobj_prev = inf;
iter = 0;
while iter < 100
iter = iter + 1;

clear cvx_P
cvx_precision high
cvx_begin quiet
variable cvx_P(K)
fobj = 0;
for k_in_cvx = 1:K
fobj = fobj + ...;    // fobj is defined as the sum of the function of cvx_P and P_prev over all k.
end
minimize ( fobj )
subject to
sum(cvx_P) <= Pmax;
cvx_P(:) <= Pmax_each(:);
cvx_P(:) >= 0
cvx_end

if norm(fobj_prev - fobj) < 1e-8
break
else
fobj_prev = fobj;
P_prev = cvx_P;
end
end
``````

The â€śfobjâ€ť function above has a term with a very large coefficient (randomly generated) and it is plugged into the logarithmic function. Due to this, results such as â€śInaccurate/Solved, Inaccurate/Unbounded, Inaccurate/Infeasibleâ€ť occurred very often depending on the value of the coefficients. However, by adding the phrase â€ścvx_precision high,â€ť I could resolve the inaccurate issue, so that the problem result has been changed to â€śSolved.â€ť Nevertheless, I am worried about some situations where the results are still in â€śInaccurateâ€ť status.

Is there a command that hides most of the results but shows whether â€śinaccurateâ€ť or â€śaccurateâ€ť only?
The â€śquietâ€ť command I use hides everything, but I only want to check if the results are correct or inaccurate without any diagnostic results.

After CVX exits, `cvx_status` contains the status of the just completed optimzation.

1 Like