フィルターのクリア

Solving Linear Programming Problem (LPP) in MATLAB

3 ビュー (過去 30 日間)
SUSHMA MB
SUSHMA MB 2015 年 6 月 15 日
I have a code for LPP mentioned below, but its showing some error which im not able to retify. Please help me with this.
function vert = feassol(A, b)
% Basic feasible solutions vert to the system of constraints
% Ax = b, x >= 0.
% They are stored in columns of the matrix vert.
[m, n] = size(A);
warning off
b = b(:);
vert = [];
if(n >= m)
t = nchoosek(1:n,m);
nv = nchoosek(n,m);
for i=1:nv
y = zeros(n,1);
x = A(:,t(i,:))\b;
if all(x >= 0 & (x ~= inf & x ~= -inf))
y(t(i,:)) = x;
vert = [vert y];
end
end
else
error('Number of equations is greater than the number of
variables.')
end
if ~isempty(vert)
vert = delcols(vert);
else
vert = [];
end
I want to run the problem, example : x1 + x2 <= 6, x2 <= 3 and x1, x2 >= 0. The constraint matrix A and the right hand sides b are A = [1 1 1 0; 0 1 0 1]; b = [6; 3]; vert = feassol(A, b)

回答 (0 件)

カテゴリ

Help Center および File ExchangeQuadratic Programming and Cone Programming についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by