Not enough input arguments. when using "gamultiobj"
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Md Enamul Haque
le 3 Mar 2018
Commenté : Md Enamul Haque
le 3 Mar 2018
I am using the below code for multi objective optimization.
D = [4, 3, 6, 8, 12, 4, 19, 13, 6, 8];
F = [20, 12, 40, 26, 10, 32, 19, 47, 11, 15];
T = 120;
H = round(rand(10,10));
nvars = 10;
A = -F;
b = -T;
Aeq = [];
Beq = [];
lb = zeros(10,1);
ub = ones(10,1);
x = gamultiobj(fitnessfcn,nvars,A,b,Aeq,Beq,lb,ub,mycon);
function xsum= constraint2(var,H)
xsum=0;
for i=1:length(H)
for j=i+1:length(H)
xsum=xsum+H(i,j)*var(i)*var(j);
end
end
end
function [c,ceq] = mycon(x,H)
c = [];
ceq = constraint2(x,H);
end
I am getting the below error. Can any one please indicate the problem?
Not enough input arguments.
Error in test1>mycon (line 36)
ceq = constraint2(x,H);
Error in test1 (line 23)
x = gamultiobj(fitnessfcn,nvars,A,b,Aeq,Beq,lb,ub,mycon);
0 commentaires
Réponse acceptée
Walter Roberson
le 3 Mar 2018
x = gamultiobj(fitnessfcn, nvars, A, b, Aeq, Beq, lb, ub, @(x) mycon(x, H));
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Quadratic Programming and Cone Programming dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!