Save all the optimization results from MultiStart and Global Search

조회 수: 4 (최근 30일)
Hello Matlab Community,
I have a questio about the Matlab Global Optimization features.
I would like to get, at the end of the optimization, all the solutions, also the ones with negative exit flags and respective parameters values.
I use the following syntax
[x,fval,exitflag,output,solutions] = run(...)
but I only get, in [solutions], the local minima with a positive exit flag, and I would like to check all the others as well.
Is there a way to accomplish what I need, that I have missed?
Many thanks and best regards.

채택된 답변

Alan Weiss
Alan Weiss 2018년 12월 14일
Sorry, no, GlobalSearch and MultiStart do not consider the points corresponding to negative local exit flags as being solutions, and so do not store them in the returned GlobalOptimSolution object.
Why do you want these points?
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 3
Alan Weiss
Alan Weiss 2018년 12월 14일
Certainly, use your output function to save the point.
Alan Weiss
MATLAB mathematical toolbox documentation
Maria Angela Agizza
Maria Angela Agizza 2018년 12월 14일
Many thanks for the advice.
Best regards.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Kurt Stewart
Kurt Stewart 2019년 3월 20일
You can make your solutions as global variables that get saved into a matrix
  댓글 수: 1
Maria Angela Agizza
Maria Angela Agizza 2019년 3월 20일
Hello, thanks for the advice.
I actually solved the problem with an output function, where I exploit the "state" of the optimization to get the parameters when the calculation reaches the maximum number of iterations (attached code).
switch state
case 'done'
save('myParametersVector','parameters');
otherwise
end

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by