This sounds like an integer programming problem. Each variable is bounded below by 0, above by 1, and the sum is fixed at 5.
ga can address mixed integer nonlinear programming problems. It has trouble with nonlinear equality constraints, but there are suggestions for how to address that limitation here.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
