Not sure if output is right

Hello I have written two programs using matlab,in which I implement the Jacobi and Gauss Seidel method.Both of the programs should terminate either if the number of iterations surpass the maximum number of iterations MAXITERATIONS or if one of these conditions/or both of them:

Re: Not sure if output is right

D is the diagonal component of the matrix A, i.e., it is a matrix whose diagonal elements are equal to the elements on the diagonals of A, while the rest are 0.

Here lies the reader who will never open this book. He is forever dead.Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and PunishmentThe knowledge of some things as a function of age is a delta function.

Re: Not sure if output is right

Sor?

Here lies the reader who will never open this book. He is forever dead.Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and PunishmentThe knowledge of some things as a function of age is a delta function.

Re: Not sure if output is right

The word jargon always reminds me of the 'e'-less game.

Here lies the reader who will never open this book. He is forever dead.Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and PunishmentThe knowledge of some things as a function of age is a delta function.

Re: Not sure if output is right

The Jacobi is not converging for some reason.

Here lies the reader who will never open this book. He is forever dead.Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and PunishmentThe knowledge of some things as a function of age is a delta function.

Re: Not sure if output is right

bobbym wrote:

You are not following. Nothing on this earth will ever get the answer to that linear system using Matlab's precision.

And what if I want to apply the methods at a 250x250 tridiagonal matrix with the number 2 at the main diagonal,-1 at the first diagonal below this and also -1 at the diagonal above this?Because both of the methods do not converge for this matrix..