output function for ga
이전 댓글 표시
I have a question regarding Matlab GA output. I run my GA for a certain number of iterations and in each iteration it minimizes a function which has nested loops. For the outputs I only get the history of i (iteration), x (parameter that leads to the minimum result), and fval-(minimum value). Is there a way that I can store the value of other variables (all of the other variables) at the end of each GA iteration? I tried to use output functions but was not able to do so.
Thanks, Ali
답변 (1개)
Alan Weiss
2015년 7월 8일
편집: Alan Weiss
2015년 7월 8일
An output function only runs at the end of an iteration, and has access to variables described in the State Structure. To log other variables in your calculation, you have a number of alternatives available, described in Share Data Between Workspaces. You can log data for any of your functions by, say, having the functions append to a global variable in the base workspace, such as
global logvariable
% more calculations here
logvariable = [logvariable;newdata];
Alan Weiss
MATLAB mathematical toolbox documentation
카테고리
도움말 센터 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!