How to execute GA properly?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, I am trying to use the Genetic algorithm from the Optimization toolbox. I receive following error for both my code and for example code called Run ga from a File included in the Matlab help.
Here is the error:
Undefined function 'ga' for input arguments of type 'optim.options.GaOptions'.
Error in go_ga (line 43)
[x,fval,exitflag,output,population,scores] = ga(@get_fitness_v1,nvars,[],[],[],[],LB,UB,[],options);
Here is part of my code:
% GA SETTINGS AND EXECUTION
options = optimoptions('ga','PopulationSize', PopulationSize,...
'InitialPopulationMatrix', InitialPopulation,...
'MaxGenerations',MaxGenerations);
[x,fval,exitflag,output,population,scores] = ga(@get_fitness_v1,nvars,[],[],[],[],LB,UB,[],options);
out = [x,fval,exitflag,output,population,scores];
Thank you in advance. Best regards JC
Antworten (1)
Walter Roberson
am 11 Mär. 2017
ga is not part of the Optimization Toolbox: it is part of the Global Optimization Toolbox.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Genetic Algorithm finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!