필터 지우기
필터 지우기

Running GA from a file

조회 수: 1 (최근 30일)
Enfa White
Enfa White 2012년 9월 28일
The contents of my file are:
[x fval exitflag output, final_pop] = ga(@e5, 1); options = gaoptimset('Generations',300, 'Display', 'none'); rng('default')% for reproducibility record=[]; for n=0:.05:1 options = gaoptimset(options,'CrossoverFraction', n); [x fval]=ga(@e5,1,[],[],[],[],[],[],[],options); record = [record; fval]; end
plot (0:0.05:1, record); xlabel('Crossover Fraction'); ylabel('fval')
but I can't run this file and there is an error at the following line: rng('default')% for reproducibility
Please help.
  댓글 수: 2
Hossein  Khaki
Hossein Khaki 2012년 9월 28일
I run it, there is no error on 'rng('default')% for reproducibility' but because of I dont have the 'e5' function it can not run completely!
Enfa White
Enfa White 2012년 9월 28일
TQ for running. How about you replace'e5' with 'rastriginsfcn' (nval is 2) and try to run again.

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

답변 (0개)

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by