This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
clear; clc; close all;
f=[-30;-30;-35];%Objective function coeff. which is maximization of profit or minimization of negative profit
A=[7 5 13;1 2 4;1 1 1];%Inequality constraints
b=[3000;1100;450];%RHS of inequality constraints
lb = zeros(3,1);%Lower bounds of the 3 variables
[x,fval,exitflag,output,lambda] = linprog(f,A,b,,,lb);%Solve the LP problem
fprintf('Optimized maximum profit is %8.4f for following weekly production.\nx1=%6.2f, x2=%6.2f and x3=%6.2f\n\nSolution is matching with the graphically solved solution.\n\n',-fval,x(1),x(2),x(3));...
This is only a preview of the solution. Please use the purchase button to see the entire solution