Multi-variable Fitness Function error using Optimization Tool
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!