|
|
Page | 52/128 | Date | 02.05.2018 | Size | 8.69 Mb. | | #47255 |
|
a. Inverse matrix
We might multiply all the elementary matrices together before multiplying by the augmented matrix. That is, carry out the evaluation of , then perform .
% Script to implement Gauss-Jordan Elimination
b=[4 1 2;1 3 1;1 2 5];
c=[16;10;12];
a=[b c];
np=size(b);
n=np(1);
for k=1:n
for m=k+1:n+1
a(k,m)=a(k,m)/a(k,k);
end
a(k,k)=1;
for l=1:n
if l~=k
for m=k+1:n+1
a(l,m)=a(l,m)-a(l,k)*a(k,m);
end
a(l,k)=0;
end
end
end
a
b. Algorithm
Share with your friends: |
The database is protected by copyright ©ininet.org 2024
send message
|
|