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
Alan Weiss 2015년 7월 8일
편집: Alan Weiss 2015년 7월 8일

0 개 추천

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

카테고리

질문:

2015년 7월 8일

편집:

2015년 7월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by