|
楼主 |
发表于 2006-5-20 22:08
|
显示全部楼层
f
楼上的,你可能是在复制程序的时候把矩阵的维数搞错了,有可能是写向量的时候忘了空格或者逗号了。
我在算这个例题的时候最后是出现了:
??? Error using ==> ga
Too many input arguments.
我个人觉得是不是
[x endPop,bPop,trace]=ga([0 9],'fitness',[],initPop,[1e-6 1 1],'maxGenTerm',25,'normGeomSelect',...
[0.08],['arithXover'],[2],'nonUnifMutation',[2 25 3])
这个函数参数太多了?
我查看了matlab7.0里面的help里的内容。那里面说明的关于ga.m函数的格式应该是为:
x = ga(fitnessfun, nvars)
x = ga(fitnessfun, nvars, options)
x = ga(problem)
[x, fval] = ga(...)
[x, fval, reason] = ga(...)
[x, fval, reason, output] = ga(...)
[x, fval, reason, output, population] = ga(...)
[x, fval, reason, output, population, scores] = ga(...)
里面没有这么多参数呀!!
x = ga(fitnessfun, nvars) applies the genetic algorithm to an optimization problem, where fitnessfun is the objective function to minimize and nvars is the length of the solution vector x, the best individual found.
希望有高人进来看看呀!! |
|