Advertisement
ikov34

Untitled

Jan 8th, 2021
1,164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.60 KB | None | 0 0
  1. f = [5 4 6 3 4];
  2. A = [];
  3. b = [];
  4. Aeq = [1 1 0 0 0;
  5.        0 0 0 1 1;
  6.        1 0 -1 -1 0;
  7.        0 1 1 0 -1];
  8. beq = [1; 1; 0;0;];
  9. lb = [0;0;0;0;0];
  10. ub = [1;1;1;1;1];
  11.  
  12. [X, fval] = intlinprog(f,[1,2,3,4,5],A,b,Aeq,beq,lb,ub);
  13.  
  14.  
  15. % Prilagojeno
  16. % x12 x13 x23 x24 x34 x35 x45
  17. %
  18. f = [5 1 64 3 4 4 5];
  19. A = [];
  20. b = [];
  21. Aeq = [1 1 0 0 0 0 0;
  22.        0 0 0 1 1 0 -1;
  23.        1 0 -1 -1 0 0 0;
  24.        0 1 1 0 -1 0 0;
  25.        0 -1 -1 0 1 1 0;
  26.        0 0 0 0 0 1 1];
  27. beq = [1; 0; 0;0;0;1];
  28. lb = [0;0;0;0;0;0;0];
  29. ub = [1;1;1;1;1;1;1];
  30.  
  31.  
  32. [X, fval] = intlinprog(f,[1,2,3,4,5],A,b,Aeq,beq,lb,ub);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement