0% found this document useful (0 votes)
47 views2 pages

Determinan Matriks PDF

This Pascal code defines a function to calculate the determinant of a square matrix. It takes a matrix and its order as input. It initializes the determinant to 1 and iterates through rows, finding the pivot element and performing row operations to convert the matrix to an upper triangular form. It multiplies the diagonal elements at each step to calculate the final determinant.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views2 pages

Determinan Matriks PDF

This Pascal code defines a function to calculate the determinant of a square matrix. It takes a matrix and its order as input. It initializes the determinant to 1 and iterates through rows, finding the pivot element and performing row operations to convert the matrix to an upper triangular form. It multiplies the diagonal elements at each step to calculate the final determinant.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

INVERS MATRIKS BERORDO n x n

Source Code (Pascal / Delphi)


function TfmMain.cariDeterminan(
matriks : array [1..100,1..100] of real;
ordo : integer;
):real;
var i,j,k,r : integer;
pivot,m,det,tampung : real;
singular:boolean;
Begin
det:=1;
k:=1;
singular:=false;

while (k<=ordo) and (not singular) do


begin
{menentukan elemen pivot}
pivot:=matriks[k,k];
r:=k;
for i:=k+1 to ordo do
if Abs(matriks[i,k]) > Abs(pivot) then
begin
pivot:=matriks[i,k];
r:=i;
end;

if pivot=0 then
Begin
singular:=true;
det:=0;
End
else
Begin
if r>k then
begin
det:=-det;
for i:=1 to ordo do
begin
tampung:=matriks[k,i];
matriks[k,i]:=matriks[r,i];
matriks[r,i]:=tampung;
end;
end;

for i:=k+1 to ordo do


begin
m:=matriks[i,k] / matriks[k,k];
for j:=1 to ordo do
Begin
matriks[i,j]:=matriks[i,j]-m*matriks[k,j];
End;
end;
end;
k:=k+1;
End;
for i:=1 to ordo do
det:=det*matriks[i,i];

cariDeterminan := det;
end;

Dirangkum kembali oleh : Mahendra Data

Referensi :
Source ini dibuat oleh dosen Jurusan Matematika Universitas Brawijaya, Bapak
Syaiful Anam.

You might also like