Codes for Gauss Seidel Method

17 ビュー (過去 30 日間)
Sam
Sam 2014 年 4 月 22 日
回答済み: Meysam Mahooti 2019 年 11 月 29 日
I am looking for matlab codes for the following...
Write a program that takes a value for n and solves for x using the following method:
Gauss-Seidel iteration starting with x_0=0 and terminating when the residual is less than 10^8 in ∞ norm. The program should output the ∞ norm of the residual of your computed solution and the number of iterations used where A =
n=10; A = full(gallery('tridiag',n,-1,2,-1));
And, I don't know how to write b as a matrix form...
And, this is the code for b... n = 100; i = 2:(n-1); bmid = i.^2 / ((n+1).^4); b = [1+1/(n+1)^4, bmid, 6+(n^2)/(n+1)^4]';

回答 (1 件)

Meysam Mahooti
Meysam Mahooti 2019 年 11 月 29 日
The Gauss–Seidel method is an iterative technique for solving a square system of n linear equations with unknown x.

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by