Return values from simulannealbnd other than fval and x

I am optimizing an objective function which depend on profit and risk as shown below. I am using simulannealbnd function to optimize decision variable x. I want to plot profit vs risk. I am unable return the values of profit and risk for best value of decision variable x as I simulannealbnd only returns objective and x variables. I shall appreciate any help in this issue.
objective = w1* profit(x) + w2* risk(x);

4 comentarios

But what stops you from then calling the functions profit(x) and risk(x)? You have x. And you apparently have those functions.
John D'Errico, thanks for response, unfortunately, that is not possible as risk and profit depend on another variable w besides x which is optimized in previous stage. The algorithm is iterative in first stage, the other variable (w) is optimized using fmincon and then x is optimized using simulannealbnd. Once x is optimized by simulannealbnd, I do not know which w have been used. So, ...
Why not record the w result of the fmincon?
Thanks, I was able to address issue by saving intermediate parameters

Iniciar sesión para comentar.

Preguntada:

el 27 de Jun. de 2017

Comentada:

el 27 de Jun. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by