MATLAB: How to set the variables as integers in a Genetic Algorithm Function

gagenetic algorithm

Hi,
Supposing the objective function is @(x)f(x(1),x(2)). I would like to set the variable 'x' as a integer in a Genetic Algorithm Function.
How should I do? Is there anyone knowing it?
Thanks, Zheng

Best Answer

Note that there are a number of restrictions on ga()'s operation when you constrain to integer.