This repository has been archived on 2021-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
NC/mp6/Project_6_Maggioni_Claudio/exercise3.m
2020-12-19 23:27:43 +01:00

27 lines
No EOL
1.3 KiB
Matlab

type = 'max';
A = [
%x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16
1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0;
0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0;
0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0;
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1;
320 0 0 0 510 0 0 0 630 0 0 0 125 0 0 0;
0 320 0 0 0 510 0 0 0 630 0 0 0 125 0 0;
0 0 320 0 0 0 510 0 0 0 630 0 0 0 125 0;
0 0 0 320 0 0 0 510 0 0 0 630 0 0 0 125;
1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1];
h = [18; 32; 25; 17; 11930; 22552; 11209; 5870; 16; 32; 40; 28];
% c is row vector form of following matrix C
C = [135; 200; 410; 520] * [1 1.1 1.2 1.3];
c = C';
c = c(:)';
sign = ones(1,12) * -1;
[z,x_B,index_B] = simplex (type,A,h,c,sign);
histogram([index_B x_B']')