File Exchange

image thumbnail

Gauss-Seidel Iterative Method

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

90 Downloads

Updated 11 Jan 2020

View Version History

View License

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.[1] 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
Copyright © 2005 John Wiley & Sons, Inc.

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 .

Comments and Ratings (5)

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
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!

Gauss Siedel