A = 3X3 Matrix
x = 3X1 Matrix
b = 3X1 Matrix
function x=gauss33(A,b)
m21=A(2,1)/A(1,1);
m31=A(3,1)/A(1,1);
A(2,:)=A(2,:)-m21*A(1,:);
A(3,:)=A(3,:)-m31*A(1,:);
b(2,1)=b(2,1)-m21*b(1,1);
b(3,1)=b(3,1)-m31*b(1,1);
m23=A(3,2)/A(2,2);
A(3,:)=A(3,:)-m23*A(2,:);
b(3,1)=b(3,1)-m23*b(2,1);
x(3,1)=b(3,1)/A(3,3);
x(2,1)=(b(2,1)-A(2,3)*x(3,1))/A(2,2);
x(1,1)=(b(1,1)-A(1,2)*x(2,1)-A(1,3)*x(3,1))/A(1,1);
반응형
'이것저것 배운것 > 수업내용 - MATLAB' 카테고리의 다른 글
Gauss_Jordan 소거법 (0) | 2014.11.11 |
---|---|
Fr_bin2dec / Fr_dec2bin (0) | 2014.11.04 |
Gauss (0) | 2014.11.04 |
Test Gauss55 (0) | 2014.11.04 |
Gauss44 (0) | 2014.11.04 |