Writing a function with many outputs, and maximizing over the first output

1 次查看(过去 30 天)
Dear all,
Hi, I want to maximize a multi-variable function myfun(x), where x is a vector over which we maximize. I'm using Global Optimization Toolbox and it takes a very long time to run. What I want is, when I stop running the Global Optimization Toolbox command, I want Matlab to give the best solution up to that point.
I think my question is, is it possible to write a function with many outputs, where the first output is what I want to maximize and the other outputs store what I want up to that point? If so, how would I write it?
I'd appreciate any and all help. Thank you!
Best, John

回答(1 个)

Alan Weiss
Alan Weiss 2015-7-22
It is possible that a global output function would do what you want. But I am not completely sure what you are asking, so if this doesn't look like a good suggestion, then try asking again.
Alan Weiss
MATLAB mathematical toolbox documentation

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by