Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [x]=gauss(A, B)
- C = rref([A B]);
- [n,m]=size(C);
- x=C(:,m);
- endfunction
- A=[7 -8 9 11; -5 6 5 3; -4 -7 3 6; 2 1 5 9];
- B=[3; -4; -6; 11];
- x = gauss(A, B);
- disp(x, "Рішення за Гаусом:");
- disp(A*x-B, "Похибка:");
- xN = x;
- i=0;
- while 1
- i = i+ 1;
- bN = A*xN;
- betha = B - bN;
- eps = gauss(A, betha);
- xN = xN + eps;
- if max(eps)<0.0001 then
- break;
- end
- end
- disp(xN, "Уточнення:");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement