Error using makeState (line 56) Your fitness function must return a scalar value.
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Genetic Algorithm dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!