How to execute GA properly?

조회 수: 1 (최근 30일)
Jan Cagan
Jan Cagan 2017년 3월 11일
댓글: Walter Roberson 2017년 3월 11일
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
  댓글 수: 5
Jan Cagan
Jan Cagan 2017년 3월 11일
Ok, now i understand, here is the reason:
>> which ga -all
C:\Program Files\MATLAB\R2016b\toolbox\globaloptim\globaloptim\ga.m % Has no license available
I thought that I have full school Matlab license :-(, but reality is in another place.
Thank you very much.
JC
Walter Roberson
Walter Roberson 2017년 3월 11일
The Student Suite does not include Global Optimization Toolbox; that has to be added on.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2017년 3월 11일
ga is not part of the Optimization Toolbox: it is part of the Global Optimization Toolbox.

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by