I am new in Scilab, I am planning to use it to do the linear programming. I googled and found this code:
Aeq = [
2 0 6
0 3 5
];
beq = [8;15;30];
c = [30;50];
[xopt]=karmarkar(Aeq,beq,c);
But it seems there is a problem with the karmarkar. Can anyone tell me how to fix my problem? I tried to use help karmarkar
because I think it might be the same with Matlab but it didn't work.
The parameters
Aeq
andbeq
represent linear equality constraints. Each row ofAeq
has the coefficients of an equation, and the corresponding row ofbeq
is the right hand side. Therefore, the number of rows inAeq
andbeq
must be the same.Also, the number of rows of
c
must be equal to the number of variables you have, in this case three.To summarize: when you have m constraints and n variables, the matrices have the following sizes:
Aeq
is m by nbeq
is m by 1c
is n by 1Working example: