The topic Mixed Integer ga Optimization adderesses this kind of question. For an example that uses integer variables for non-integer discrete optimization, see Solving a Mixed Integer Engineering Design Problem Using the Genetic Algorithm. For details on using the genetic algorithm in MATLAB®, see ga and the Genetic Algorithm topic.
Alan Weiss
MATLAB mathematical toolbox documentation