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 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](/WebImages/7/write-a-matlab-function-xzsimplexabc-for-solving-the-lp-maxi-991988-1761510188-0.webp)
