Invalid value for OPTIONS parameter InitialPopulationMatrix.
0 Kommentare
Akzeptierte Antwort
2 Kommentare
Weitere Antworten (5)
https://www.mathworks.com/help/gads/gaoptimset.html
"InitialPopulationMatrix: Initial population used to seed the genetic algorithm. Has up to PopulationSize rows and N columns, where N is the number of variables."
Your 1 x 256 matrix would therefore be appropriate if you had 256 variables, but you only have 1 variable.
You need to use the transpose of your population matrix, to give 256 rows with 1 column.
3 Kommentare
Hi,
so far i found three problems with your code:
1. replace your ki-variable by populationsize
options = gaoptimset('InitialPopulation',populationsize,...
instead of
options = gaoptimset('InitialPopulation',ki,...
2. Too many input arguments for your Crossover Function
'CrossoverFcn', {@crossoverscattered},...
instead of
'CrossoverFcn', {@crossoverscattered,0.8},...
3. The result of your option for 'EliteCount' is not an integer but it has to be. So ether you delete this option (i guess your choosen value is the standard value) or use the worlds best number for example:
'EliteCount',42,...
instead of
'EliteCount',0.05*1,...
After changing the code this way your code worked for me.
That helped?.
1 Kommentar
Hi,
what is the result when you type
whos si
seems like Matlab doesnt accept this parameter.
1 Kommentar
Hi,
try:
options = gaoptimset('InitialPopulation',ki',...
instead of
options = gaoptimset('InitialPopulation',ki,...
1 Kommentar
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!