Write a matlab function xzsimplexAbc for solving the LP maxi

Write a matlab function [x,z]=simplex(A,b,c) for solving the LP maximize c\'x subject to Ax<=b, x>=0, where b>0. The outputs x and z are an optimal solution and the optimal objective function value, respectively.

Would anyone be able to show me this on matlab, I have not used matlab in forever.

Solution

x = linprog(f,A,b) solves min f\'*x such that A*x b.

find the code below

function [ x,z ] = Simplex( A,b,c )

x = linprog(-c,A,b)
z = c*x
end

Write a matlab function [x,z]=simplex(A,b,c) for solving the LP maximize c\'x subject to Ax<=b, x>=0, where b>0. The outputs x and z are an optimal sol

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site