필터 지우기
필터 지우기

Saving the design variable's history in optimization

조회 수: 8 (최근 30일)
Mayank
Mayank 2013년 5월 14일
I'm using the global optimization tools ga and sa. Now, I want to have the history of the changes made in the design variables, not in a plot but in a text file which contains the values of the variables at each iteration. How can this be done?

채택된 답변

Alan Weiss
Alan Weiss 2013년 5월 17일
This can be done easily using an Output Function. The documentation for ga is here, and the documentation for sa is here.
Basically, at each stage in the algorithm, append the current point to a matrix, such as with the command
xhistory = [xhistory;x];
There is an example here showing how to use output functions for a similar purpose, but be careful because this solver uses a different syntax.
Alan Weiss
MATLAB mathematical toolbox documentation

추가 답변 (0개)

카테고리

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