MATLAB: Problems with defining upper and lower bounds

boundgenetic algorithmGlobal Optimization Toolbox

Hi!
I'm trying to run GA with
[x fval] = ga(@objectiveFunction, nvars, [],[],[],[],lower, upper,[], integers, options)
Where:
nvars = 2,
lower = [3 3]
upper = [13 10]
integers = []
Problem is that the parameters sent to the objective function from the GA sometimes are outside the bounds i've specified.
For testing the objective function now only writes it's input to the console and returns a fixed number.
Here's a part of the console output:
param =
0.7289 3.1917
param =
0.9995 7.7736
param =
-1.2105 3.4438
param =
7.9082 6.2424
As you can see several of the values are outside the allowed range. What have i done wrong?
Best regards.
Daniel

Best Answer

I solved it by using @mutationadaptfeasible as mutation function!