how could I check if a matrix is diagonally dominant through jacobi method?whats the code for the equivalant M-file?

4 views (last 30 days)
here's the file I have till nowfunction X=jacobi(A,B,X0,tol,kmax) N =length(B); for k=1:kmax for j=1:N X(j)=(B(j)-A(j,[1:j-1,j+1:N])*X0([1:j-1,j+1:N]))/A(j,j); end err=abs(norm((X'-X0),inf)); X0=X' if err<tol break break end end X=X';

Answers (0)

Categories

Find more on Operating on Diagonal Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!