Filter löschen
Filter löschen

Not enough input arguments. when using "gamultiobj"

1 Ansicht (letzte 30 Tage)
Md Enamul Haque
Md Enamul Haque am 3 Mär. 2018
Kommentiert: Md Enamul Haque am 3 Mär. 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);

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 3 Mär. 2018
x = gamultiobj(fitnessfcn, nvars, A, b, Aeq, Beq, lb, ub, @(x) mycon(x, H));

Weitere Antworten (0)

Kategorien

Mehr zu Quadratic Programming and Cone Programming finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by