f = [42 35 50 67 52 26 7 38;27 20 35 52 40 14 22 23;18 11 26 43 40 14 31 15;13 24 39 56 53 27 44 28;17 21 36 53 53 28 41 29;25 18 33 50 43 21 26 22;33 26 41 57 41 15 18 30;41 34 48 55 39 13 25 38;38 31 46 54 32 6 27 31;42 29 38 45 32 17 30 39;37 29 38 45 35 27 39 35;30 24 33 46 42 34 46 36;24 13 28 45 45 24 41 25;16 9 24 41 41 16 33 17;20 5 20 37 37 20 37 21;25 10 19 32 32 25 42 26;28 13 22 35 29 27 45 29;39 24 33 40 30 22 35 38;44 29 38 37 24 16 38 41;40 32 41 40 18 8 41 33;41 26 35 34 16 14 46 39;37 22 31 30 20 18 45 38;33 18 27 32 24 22 44 34;35 20 21 26 33 35 52 36;29 14 15 28 36 29 46 30;26 11 14 32 39 26 43 27;29 14 11 31 42 29 46 30;32 17 12 25 39 32 49 33;37 22 17 20 35 37 54 38;44 29 28 18 24 31 58 45;41 26 35 24 17 24 51 42;48 33 42 34 9 17 50 42;54 39 48 28 3 23 56 48;46 31 40 19 12 29 56 47;52 37 36 10 21 38 65 53]
a = ones(35,8)
b = [6.5 10.2 12 14.3 13 11 14 9.5 10 8.4 10.5 7 8.5 12 11.6 12.5 13.6 9 7.3 10 12.7 7.4 6.7 12.5 9.6 15 7.2 8.9 10.3 9 7.7 8 11.4 12.1 10.7];
aeq = ones(8,35);
beq = [40;45;30;38;29;35;25;28];
[x,y] = linprog(f,a,b,aeq,beq,zeros(35,8));
x,y = -y
错误使用 linprog (line 236)
The number of columns in A must be the same as the number of elements of f.
出错 Untitled (line 7)
[x,y] = linprog(f,a,b,aeq,beq,zeros(35,8));
a = ones(35,8)
b = [6.5 10.2 12 14.3 13 11 14 9.5 10 8.4 10.5 7 8.5 12 11.6 12.5 13.6 9 7.3 10 12.7 7.4 6.7 12.5 9.6 15 7.2 8.9 10.3 9 7.7 8 11.4 12.1 10.7];
aeq = ones(8,35);
beq = [40;45;30;38;29;35;25;28];
[x,y] = linprog(f,a,b,aeq,beq,zeros(35,8));
x,y = -y
错误使用 linprog (line 236)
The number of columns in A must be the same as the number of elements of f.
出错 Untitled (line 7)
[x,y] = linprog(f,a,b,aeq,beq,zeros(35,8));