Search This Blog

Saturday, September 15, 2012

Calling GLPK From Matlab Example

Make sure you have downloaded glpkmex and you matlab current working directory is glpkmex

Example:
   c = [10, 6, 4]';
  a = [ 1, 1, 1;
      10, 4, 5;
       2, 2, 6];
  b = [100, 600, 300]';
  lb = [0, 0, 0]';
  ub = [];
  ctype = "UUU";
  vartype = "CCC";
  s = -1;
 param.msglev = 1;
param.itlim = 100;
 [xmin, fmin, status, extra] = ...
   glpk (c, a, b, lb, ub, ctype, vartype, s, param);

No comments:

Post a Comment

Thank you