Variable x at each generation

While optimization through GA, how to get variable value at each generation? Say If I am doing for y=x^2-2x+78, I am getting final x value. I want to get x value at each generations?

回答 (1 件)

Alan Weiss
Alan Weiss 2014 年 5 月 7 日

0 投票

Alan Weiss
MATLAB mathematical toolbox documentation

3 件のコメント

GA optimization
GA optimization 2014 年 5 月 7 日
When I enable iterative display, it displays best objective function and mean objective function(i.e. y or f(x)) and f-count and stall generation at each generation. I want value of of x(1), x(2)( say if use y=x(1)^2+x(2)^2-58 equation for optimization)at each generation. Can you please tell me how to write output function for this?
Alan Weiss
Alan Weiss 2014 年 5 月 7 日
You can write an output function along these lines. Be careful, GA uses a slightly different syntax for its output functions; refer to my previous link.
Alan Weiss
MATLAB mathematical toolbox documentation
GA optimization
GA optimization 2014 年 5 月 7 日
Hi, I tried, it is not working. Will you please write the code using above mentioned function or any function to get x(1) and x(2) value at each generations.

サインインしてコメントする。

カテゴリ

タグ

質問済み:

2014 年 5 月 5 日

コメント済み:

2014 年 5 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by