I want to minimize a very simple function.
function z=f(x)
f=(x(1)-2)^2+(x(2)-1)^2
end
and I write this in matlab command window:
>> [x fval]=ga(@f,2)
But I get this error:
??? Error using ==> ga
Too many input arguments.
Any suggestions to fix this problem?
which gareturn? - DanielC:\Users\student\Documents\MATLAB\ga.m- ali meghdadiga.m? - melmi