// This solves Example 5 in 9.3 of the Lin algebra text by Lay. // We use -p as the scilab looks for a min // // Example 5 is: // Maximize 25x_1 + 33x_2 + 18x_3 subject to // 2x_1 + 3x_2 + 4x_3 <= 60 // 3x_1 + x_2 + 5x_3 <= 46 // x_1 + 2x_2 + x_3 <= 50 // and x_1, x_2, x_3 >= 0 -->p=[25; 33; 18] p = 25. 33. 18. -->b=[60;46;50] b = 60. 46. 50. -->c=[2 3 4; 3 1 5;1 2 1] c = 2. 3. 4. 3. 1. 5. 1. 2. 1. -->[x,lagr,f]=linpro(-p,c,b,[0,0,0]',[]) f = - 693.42857 lagr = 0. 0. - 30.714286 10.571429 1.2857143 0. x = 11.142857 12.571429 0. -->diary(0)