Error using makeState (line 56) Your fitness function must return a scalar value.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello Matlab users I'm getting started with GA and trying to apply it to maximization problem I have. Running the Genetic Algorithm gives the following error:
Error using makeState (line 56) Your fitness function must return a scalar value. Error in galincon (line 17) state = makeState(GenomeLength,FitnessFcn,Iterate,output.problemtype,options);
Error in ga (line 359) [x,fval,exitFlag,output,population,scores] = galincon(FitnessFcn,nvars, ...
Error in GA (line 24) [x,fval,reason,output,population,scores]=ga(@MyCost,24,[],[],[],[],lb,up,[],option);
Error in galincon (line 17) state = makeState(GenomeLength,FitnessFcn,Iterate,output.problemtype,options);
Error in ga (line 359) [x,fval,exitFlag,output,population,scores] = galincon(FitnessFcn,nvars, ...
Error in GA (line 25) [x,fval,reason,output,population,scores]=ga(@MyCost,24,[],[],[],[],lb,up,[],option);
I attached my code,I would be grateful if you help me.
Thanks
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Genetic Algorithm en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!