Passing extra outputs from cost function
1 view (last 30 days)
Show older comments
Dear Matlab Community,
I am using a GA to optimise a certain function, but I want to keep saving some additional data.
f=@(x)requestFitting(extractionInit,x); problemMultiga.fitnessfcn=f;
with
[f,extractionFit] = requestFitting(extractionInit,x)
The problem is, that through the function handle, information on the output of the cost function:extractionFit is lost.
Please help me, how can I save additional outputs of the cost function?
Thanks a lot!
[cost,]
0 Comments
Accepted Answer
Alan Weiss
on 6 Dec 2016
There are several ways. Proper use of nested functions is one way. Using an output function is another.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
6 Comments
Kurt Stewart
on 11 Oct 2019
I tried parallel and it didnt seem to be a problem, I would have to know more about resource sharing that Matlabs pools do
More Answers (0)
See Also
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!