A=[5 -1 2; 1 -6 1; 1 1 4];
b=[6 -4 6]';
[x,iter]=jacobi(A,b,10^-6,100)

A=[1 1 4; 1 -6 1; 5 -1 2];
b=[6 -4 6]';
[x,iter]=jacobi(A,b,10^-6,100)

A=[-1 0.5 0.5; 0.7 -1 1.1; 0.3 -1 -1];
b=[1 -2 1]';
[x,iter]=jacobi(A,b,10^-6,100)

[x,iter]=gaussseidel(A,b,10^-6,100)

norm(A*x-b)