# Numerical analysis,results of methods

#### evinda

##### Well-known member
MHB Site Helper
Hi!
I have written two codes in matlab,to implement the Jacobi and Gauss Seidel method.Both of the programs should stop either if the number of iterations surpass the maximum number of iterations MAXIT or if one of these conditions/or both of them:

$$\left \| x_{k}-x_{k-1} \right \|_{2}$$<ε , $$\left \| b-Ax_{k} \right \|_{2}$$<ε

are valid.

Could you give me the results of an example with an initial value $$x_{0}$$,an array A ,a specific b,a specific MAXIT and a specific small number ε,so I can check my output?

Last edited:

#### evinda

##### Well-known member
MHB Site Helper
If,for example:

A=[3 2 1 5;6 2 1 3;5 5 6 1;1 2 3 9]
$$x_{0}$$ =[0;0;0;0]
b=[1;2;3;4]
MAXIT=20
ε=0.00001

which should be the solution of x??