I wrote the following function in MATLAB:
function EX_EFFICIENCY=EXERGY_EFFICIENCY_FUNCTION(CR,ER,PC,T0,P0)
I used the following order (ga):
x = ga(@EXERGY_EFFICIENCY_FUNCTION,5)
But it gets the error:
Not enough input arguments.
Error in EXERGY_EFFICIENCY_FUNCTION (line 22) T7p=T0.*(PC.^((k-1)./k));
Error in createAnonymousFcn>@(x)fcn(x,FcnArgs{:}) (line 11) fcn_handle = @(x) fcn(x,FcnArgs{:});
Error in makeState (line 47) firstMemberScore = FitnessFcn(state.Population(initScoreProvided+1,:));
Error in gaunc (line 40) state = makeState(GenomeLength,FitnessFcn,Iterate,output.problemtype,options);
Error in ga (line 398) [x,fval,exitFlag,output,population,scores] = gaunc(FitnessFcn,nvars, ...
Caused by: Failure in initial user-supplied fitness function evaluation. GA cannot continue.
How can I minimize this function?
ga
wants the handle to a function with one input argument. You give it one that needs 5 arguments. That will not work, of course. – Cris Luengo