File Exchange

## Gauss-Seidel Iterative Method

version 1.1.0 (1.99 KB) by
The Gauss–Seidel method is an iterative technique for solving a square system of n linear equations with unknown x.

Updated 11 Jan 2020

In numerical linear algebra, the Gauss–Seidel method, also known as the Liebmann method or the method of successive displacement, is an iterative method used to solve a linear system of equations. It is named after the German mathematicians Carl Friedrich Gauss and Philipp Ludwig von Seidel, and is similar to the Jacobi method. Though it can be applied to any matrix with non-zero elements on the diagonals, convergence is only guaranteed if the matrix is either diagonally dominant, or symmetric and positive definite. It was only mentioned in a private letter from Gauss to his student Gerling in 1823. A publication was not delivered before 1874 by Seidel.

Reference:
Applied Numerical Methods Using MATLAB®
Author(s): Won Young Yang, Wenwu Cao, Tae‐Sang Chung, John Morris
First published:14 January 2005
Print ISBN:9780471698333 |Online ISBN:9780471705192 |DOI:10.1002/0471705195

### Cite As

Meysam Mahooti (2021). Gauss-Seidel Iterative Method (https://www.mathworks.com/matlabcentral/fileexchange/73488-gauss-seidel-iterative-method), MATLAB Central File Exchange. Retrieved .

Dave Plouffe

From the source code in the while loop we can see this line:
x(:,k+1) = -inv(D+L)*(U)*x(:,k) + inv(D+L)*b;% Gauss-Seidel formula

The whole point of usign Gauss-Seidel iterative method is to not calculate the inverse of matrix A in the equation Ax = b.
Hence, this function is NOT an implementation of Gauss-Seidel iterative method.

Mohamed Remmas

Md. Rajibul Islam

What if I want to see the results of each iteration without checking the convergence? This code throughs wrong values if I remove those convergence checking code lines. Please help.

Caglar Coskun

Horst Heck

##### MATLAB Release Compatibility
Created with R2019a
Compatible with any release
##### Platform Compatibility
Windows macOS Linux