clear all;
clc;
m=input('Are there equality constraints?\n If yes type 1.
Else type 2\n');
if m==1
Aeq=input('Enter
equality constraints coefficient in matrix form\n');
beq=input('Enter
the bi of equality constraints as column vector\n');
else
Aeq=[];
beq=[];
end
f=input('Enter the coefficient of Objective function as
column vector\n ');
A=input('Enter the constraint coefficients in matrix
form\n');
b=input('Enter bi as column vector\n');
intcon=input('Enter the integer variables in matrix form, i
is the index of integer variable');
n=length(f);
[x,fval,exitflag] = intlinprog(f,intcon,A,b,Aeq,beq);
disp(x);
disp(fval);
Comments
Post a Comment