how to pass multidimensional population matrix to gaoptimset() function??..
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Matt J
am 8 Jul. 2013
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 Kommentare
Matt J
am 8 Jul. 2013
Bearbeitet: Matt J
am 8 Jul. 2013
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.
Siehe auch
Kategorien
Mehr zu Genetic Algorithm finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!