Professional Documents
Culture Documents
ABSTRACT
In everyday life several solutions to problems are needed with mathematical equations. Most
are depicted in mathematical equations that have variables. And from these variables, it can
be seen how many minimum requirements must be met. for example, in the following case
that calculates how much sand the engineer must take when he needs sand 4800m3, fine
gravel 5800 m3, and 5700 m3 coarse gravel. And with the known pit data, it can be known
with the help of the gauss-jordan elimination so that x, y, z can be known. and it is obtained
much as 33 m3 sand volume, fine gravel 63.4651 m3 and coarse gravel 65.5581 m3 each pit.
Keywords: Gauss-jordan method, Linear Equation, Volume pit
x=zeros(1,m);
for s=m:-1:1
c=0;
for k=2:m
c=c+A(s,k)*x(k);
end
x(s)= (A(s,n)-c)/A(s,s);
end
disp('Gauss elimination method:');
A
x'
% METODE GAUSS-JORDAN
[m,n]=size(A);
for j=1:m-1
for z=2:m
if A(j,j)==0
t=A(1,:);A(1,:)=A(z,:);
A(z,:)=t;
end
end
for i=j+1:m
A(i,:)=A(i,:)-A(j,:)*(A(i,j)/A(j,j));
end
end
for j=m:-1:2
for i=j-1:-1:1
A(i,:)=A(i,:)-A(j,:)*(A(i,j)/A(j,j));
end
end
for s=1:m
A(s,:)=A(s,:)/A(s,s);
x(s)=A(s,n);
end
disp('Gauss-Jordan method:');
A
x'
Hasil
A =
1.0e+03 *
ans =
33.0000
63.4651
65.5581
Gauss-Jordan method:
A =
1.0000 0 0 33.0000
0 1.0000 0 63.4651
0 0 1.0000 65.5581
ans =
33.0000
63.4651
65.5581