how can i give a non-linear constraint for genetic algorithm (GA) in matlab toolbox (GATool) ....my constraint is x*y*z=82368, where x,y,z are the variables.........please help me

I was carrying out a genetic algorithm optimization problem, which is a 3 variable, 1 constraint problem....but i am not able to give the non-linear constraint (x*y*z=82368) in the GATool box of matlab.....can anyone help me out........ what is the format of giving such a constraint...... thank you

Answers (2)

x = ga(fitnessfcn,nvars,A,b,Aeq,beq,LB,UB, @(x) deal([],prod(x)-82368) )

2 Comments

thank you sir..... can you please explain what it means, i means "@(x) deal([],prod(x)-82368)".....how does matlab interprets it...... thank you
For example,
>> nonlcon = @(x) deal([],prod(x)-82368);
>> [c,ceq]=nonlcon([1,2,3])
c =
[]
ceq =
-82362

Sign in to comment.

Asked:

on 25 Oct 2013

Commented:

on 25 Oct 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!