how to pass multidimensional population matrix to gaoptimset() function??..
1 次查看(过去 30 天)
显示 更早的评论
I need to pass the multidimensional population matrix to the gaoptimset() in the following way:
[[2 3 4 5; 1 3 5 2; 8 1 4 2],
[1 5 7 6; 1 3 5 2; 8 1 4 2],
[2 3 4 5; 1 3 5 2; 8 1 4 2],
.
.
.
.;]
How can I do that??.. and how can I access it??
if I need to
0 个评论
回答(1 个)
Matt J
2013-7-8
You can use gaoptimset to set the InitialPopulation and PopulationSize options
You can access the current population in any time by using the OutputFcns option
which will return a state structure containing a Population field.
2 个评论
Matt J
2013-7-8
编辑:Matt J
2013-7-8
You must organize your initial population as a standard MxN matrix where M is the population size (or less) and N is the number of unknown variables. GA will then pass population members in vector form to the fitness function. However, inside the fitness function, you can reshape() the vector of unknowns into whatever array shape you see fit.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!