The document discusses two matrix methods - checking if a matrix is diagonally dominant by comparing the sum of absolute values of each row minus the diagonal to the diagonal element, and using Gauss-Jacobi iteration to solve a system of linear equations Ax=b by iteratively updating an initial guess vector until it converges within a tolerance.
The document discusses two matrix methods - checking if a matrix is diagonally dominant by comparing the sum of absolute values of each row minus the diagonal to the diagonal element, and using Gauss-Jacobi iteration to solve a system of linear equations Ax=b by iteratively updating an initial guess vector until it converges within a tolerance.
The document discusses two matrix methods - checking if a matrix is diagonally dominant by comparing the sum of absolute values of each row minus the diagonal to the diagonal element, and using Gauss-Jacobi iteration to solve a system of linear equations Ax=b by iteratively updating an initial guess vector until it converges within a tolerance.
A = input('Enter a Matrix') R = sum(abs(A),2); D = abs(diag(A)); W = R-D; Check = D>=W DD = all(Check);
D = 0 : It's means that matrix will not diagonally dominant
D = 1 : It's means that matrix is diagonally dominant
" Guass Jaccobi Method "
A = input('Enter a Matrix A'); B = input('Enter a Matrix B'); P = input('Enter initial Guess Vector:'); n = input('Enter no of iteratrions: '); e = input('Enter your tollerance:'); N = length(B); X = zeros(N,1); for j =1:n for i = 1:N X(i) = (B(i)/A(i,i)) - (A(i,[1:i-1,i+1:N])*P([1:i-1,i+1:N]))/A(i,i); end fprintf('Iteration no %d/n',j) X if abs(X-P)<e break end P = X; end