Borrar filtros
Borrar filtros

Not enough input arguments. when using "gamultiobj"

1 visualización (últimos 30 días)
Md Enamul Haque
Md Enamul Haque el 3 de Mzo. de 2018
Comentada: Md Enamul Haque el 3 de Mzo. de 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);

Respuesta aceptada

Walter Roberson
Walter Roberson el 3 de Mzo. de 2018
x = gamultiobj(fitnessfcn, nvars, A, b, Aeq, Beq, lb, ub, @(x) mycon(x, H));

Más respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by