function [c, ceq] = simple_constraint(x)c = [1.5 + x(1)*x(2) + x(1) - x(2);...-x(1)*x(2) + 10];ceq = []; byObjectiveFunction = @simple_fitness;nvars = 2; % Number of variables
LB = [0 0]; % Lower bound
UB = [1 13]; % Upper bound
ConstraintFunction = @simple_constraint;rng(1,'twister') % for reproducibility
[x,fval] = ga(ObjectiveFunction,nvars,... [],[],[],[],LB,UB,ConstraintFunction)
MATLAB: I am trying the hands on examples on genetic algorithms in MATHWORK CENTRAL. I would like someone to explain to me what the empty matix means .I saw it was defined for for equality contraints. But why are there four
ga
Related Question
- Three inequality constraints for multi-objective genetic algorithm
- Error for ‘fmincon’ for global optimization
- Defining Objective Function in Genetic Algorithm
- How to direct the variable in the genetic algorithm function to workspace function
- I’m getting followig errors when options are used in ga solver
Best Answer