So I was able to change the format of my code and I do not get the error again. However, it gives me a new error:
Error using makeState (line 56)
Your fitness function must return a scalar value.
Error in gaunc (line 40)
state = makeState(GenomeLength,FitnessFcn,Iterate,output.problemtype,options);
Error in ga (line 356)
[x,fval,exitFlag,output,population,scores] = gaunc(FitnessFcn,nvars,
...
Error in complete_code (line 266)
[x,fval] = ga(@obj_func,3);
Can anyone please tell me what this means? And possibly what do you recommend me to do to make it right? Thank you so very much.
Best Answer