Please help me to solve the errors in the program
9 views (last 30 days)
Show older comments
clc
IntCon = 1;
function z=fun(x)
z = ((x(1)^2 + x(2)^2 - 11)^2 + (x(1)+ x(2)^2 - 7)^2 );
A = [];
b = [];
Aeq = [];
beq = [];
lb = [0 0];
ub = [6 6];
nonlcon = [];
x = ga(@fun,2,A,b,Aeq,beq,lb,ub,nonlcon,IntCon)
0 Comments
Answers (1)
Walter Roberson
on 9 May 2021
Just need the definition for the function to be below the rest of the script.
IntCon = 1;
A = [];
b = [];
Aeq = [];
beq = [];
lb = [0 0];
ub = [6 6];
nonlcon = [];
x = ga(@fun,2,A,b,Aeq,beq,lb,ub,nonlcon,IntCon)
function z=fun(x)
z = ((x(1)^2 + x(2)^2 - 11)^2 + (x(1)+ x(2)^2 - 7)^2 );
end
0 Comments
See Also
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!