The Application of Gauss-Jordan Method in Construction. Study Case: Determining The Amount of Material Needed in Building Project
The Application of Gauss-Jordan Method in Construction. Study Case: Determining The Amount of Material Needed in Building Project
The Application of Gauss-Jordan Method in Construction. Study Case: Determining The Amount of Material Needed in Building Project
https://www.convict.lu/Jeunes/Mat
Input
Gauss- h/Gauss_Jordan_Elimination.htm
Jordan https://www.geeksforgeeks.org/pro
function gram-for-gauss-jordan-elimination-method/
using for https://www.matesfacil.com/englis
command h/high/solving-systems-by-Gaussian-
Elimination.html
Value of x,
y and z
END
clear all
clc
% 52x+20y+25z=4800
% 30x+50y+20z=5800
% 18x+30y+55z=5700
C=[A B]
% GAUSS-JORDAN METHOD
[m,n]=size(C);
for j=1:m-1
for z=2:m
%PIVOTING
if C(j,j)==0
%PIVOTING
t=C(1,:);C(1,:)=C(z,:);
%PIVOTING
C(z,:)=t;
%PIVOTING
end
%PIVOTING
end
for i=j+1:m
C(i,:)=C(i,:)-
C(j,:)*(C(i,j)/C(j,j)); %Convert
the elements below the major
diagonal to zeros
end
end
for j=m:-1:2
for i=j-1:-1:1
C(i,:)=C(i,:)-
C(j,:)*(C(i,j)/C(j,j));
end
end
for s=1:m
C(s,:)=C(s,:)/C(s,s);
x(s)=C(s,n);
end
disp('Gauss-Jordan method:');
C
x'