Error using makeState (line 56) Your fitness function must return a scalar value.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Genetic Algorithm finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!