'how to get the gradient value through cvx commands'

I think convex problem is solved by Lagrangian dual method through cvx toolbox.So the gradient value should be caculated and saved. The question is how should I get the value by using commands?

Exactly what gradient do you want, and why do you think CVX knows its value? CVX transforms the problem entered in CVC into a conic formulation acceptable to the conic solver it will call, calls the conic solver to solve it using a conic interior point method to find an optimal solution, which is returned to CVX, and transformed by CVX back to the objective function and variables as defined in the CVX program. There’ s no reason to think the solver calculates the gradient you want, let alone that it is provided by the solver o CVX.

Perhaps you are used to working with traditional, non-conic Nonlinear Programming (NLP) solvers, such as FMINCON or IPOPT. Yes, they calculate gradients galore, and return them to the user if requested.

1 Like

I see. thanks for your answer. :grinning: