Saving a matrix that have been created in a function in order to use it later.

8 次查看(过去 30 天)
I use fmincon to minimize a function subject to nonlinear constraints. Every time a fmincon calls for a constraint evaluation i want save the values of the constraints, because i will need them on the next constraint evaluation.
  2 个评论
Dennis_Pana
Dennis_Pana 2017-4-19
What i am trying to do is to save the values of the constraint after the 1st objective function evaluation. Then i want to use the values of the constraints i have from the first function evaluation in order to approximate the values of the constraints on the second objective function evaluation. My question is if and how i can save the values of the constraints in order to use them on the next constraint evaluation?? It sounds difficult to me. I am trying to find a solution to the issue but i cannot.

请先登录,再进行评论。

回答(1 个)

dpb
dpb 2017-4-19
You don't have to try to do that; use the functional form for the constraints for fmincon to call whenever it needs to evaluate the constraints--

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by