Can you explain this situation?

You are solving DIFFERENT problems in CVX and fminbnd .I wasn’t complete enough in my answer to your previous question (help) Disciplined convex programming error: Invalid quadratic form(s): not a square , which served as the basis for your CVX code in this current topic.

pow_pos(q,3) is not the same as q^3. they are the same when q >= 0. However, when q < 0, the former is 0, whereas the latter is the negative number, q^3.

As I wrote in your earlier question, your original problem as written was non-convex. However, if a, b, c are all nonnegative, and q is constrained to be nonnegative, then the program can be rewritten using pow_pos. However, I should have specified that either an explicit nonegativity constraint needed to be specified for q, or d*q should have been replaced by d*pos(q). Otherwise, CVX could make q negative to the improper benefit of its objective function through the d*q term… If you do that, and make 0 the lower bound for fminbnd, then you should get agreement (presuming the upper bound for fminbnd is high enough).