I have the following fitness function:
function f = objfun(x,t)
f = x.*(t-x);
end
When i try to use this code as a fitness function using MATLAB's Optimization Tool and the Genetic Algorithm (ga) solver, i get the following error:
Error running optimization. Not enough input arguments.
I know the function has only 2 variables and I'm passing it those few variables so I have no idea why I am getting this error.
Can someone please help me fix this?