Matlab 高斯-赛德尔迭代法怎么用呢?(关键是怎么调用它,附代码)function X=gseid(A,B,P,delta,max1)% Input - A is an N x N nonsingular matrix% - B is an N x 1 matrix% - P is an N x 1 matrix; the initial guess% - delta is the toler

来源:学生作业帮助网 编辑:六六作业网 时间:2024/05/03 17:11:55
Matlab高斯-赛德尔迭代法怎么用呢?(关键是怎么调用它,附代码)functionX=gseid(A,B,P,delta,max1)%Input-AisanNxNnonsingularmatrix%

Matlab 高斯-赛德尔迭代法怎么用呢?(关键是怎么调用它,附代码)function X=gseid(A,B,P,delta,max1)% Input - A is an N x N nonsingular matrix% - B is an N x 1 matrix% - P is an N x 1 matrix; the initial guess% - delta is the toler
Matlab 高斯-赛德尔迭代法怎么用呢?(关键是怎么调用它,附代码)
function X=gseid(A,B,P,delta,max1)
% Input - A is an N x N nonsingular matrix
% - B is an N x 1 matrix
% - P is an N x 1 matrix; the initial guess
% - delta is the tolerance for P
% - max1 is the maximum number of iterations
% Output - X is an N x 1 matrix:the gauss-seidel approximation to
% the solution of AX = B
% NUMERICAL METHODS:Matlab Programs
% (c) 2004 by John H.Mathews and Kurtis D.Fink
% Complementary Software to accompany the textbook:
% NUMERICAL METHODS:Using Matlab,Fourth Edition
% ISBN:0-13-065248-2
% Prentice-Hall Pub.Inc.
% One Lake Street
% Upper Saddle River,NJ 07458
N = length(B);
for k=1:max1
for j=1:N
if j==1
X(1)=(B(1)-A(1,2:N)*P(2:N))/A(1,1);
elseif j==N
X(N)=(B(N)-A(N,1:N-1)*(X(1:N-1))')/A(N,N);
else
%X contains the kth approximations and P the (k-1)st
X(j)=(B(j)-A(j,1:j-1)*X(1:j-1)'-A(j,j+1:N)*P(j+1:N))/A(j,j);
end
end
err=abs(norm(X'-P));
relerr=err/(norm(X)+eps);
P=X';
if (err

Matlab 高斯-赛德尔迭代法怎么用呢?(关键是怎么调用它,附代码)function X=gseid(A,B,P,delta,max1)% Input - A is an N x N nonsingular matrix% - B is an N x 1 matrix% - P is an N x 1 matrix; the initial guess% - delta is the toler
A=diag(ones(1,50)*12);
A=A+[[zeros(49,1) -2*diag(ones(1,49))];zeros(1,50)];
A=A+[[zeros(1,49); -2*diag(ones(1,49))] zeros(50,1)];
A=A+[[zeros(48,2) diag(ones(1,48))];zeros(2,50)];
A=A+[[zeros(2,48); diag(ones(1,48))] zeros(50,2)];
b=ones(50,1)*5;
x=gseid(A,b,zeros(50,1),0.001,1000)

在MATLAB中用求解高斯—塞德尔迭代法线性方程组 Matlab 高斯-赛德尔迭代法怎么用呢?(关键是怎么调用它,附代码)function X=gseid(A,B,P,delta,max1)% Input - A is an N x N nonsingular matrix% - B is an N x 1 matrix% - P is an N x 1 matrix; the initial guess% - delta is the toler 给定以下线性方程组,用雅可比迭代法和高斯-塞德尔迭代法是否收敛? 请问怎么用matlab编程,使用牛顿迭代法求根号5的立方的近似值? 牛顿迭代法能否求出虚根,用matlab怎么编程,例如x^5+1=0 怎样用高斯-赛德尔迭代法求解矩阵方程组 用fortran怎么编写牛顿迭代法 如何比较高斯迭代法与雅克比迭代法哪一个收敛的更快 用不动点迭代法求某函数的近似解的matlab程序怎么写?还有怎么求迭代次数和怎么要求精确度. ..matlab仿真特殊边界电场分布..用超松弛迭代法在matlab仿真特殊边界电场分布.求matlab代码. 求matlab编程 用二分法和牛顿迭代法求根号a 谁会用迭代法分割图像我这有代码 matlab代码 我可以提高悬赏分 matlab中 编程用迭代法求方程1-x=sinx的根.亲们, 在用matlab编写Jacobi迭代法求线性方程组时一直出现这个问题, 在MATLAB中用求解高斯—塞德尔迭代法线性方程组程序我笨的可怜,.(2)使用高斯—塞德尔迭代法解下述方程组.「10 -1 2 0 | | X1| | 6 || -1 11 -1 3 | | X2| = | 25|| 2 -1 10 -1 | | X3| |-11|| 0 3 -1 8 」 | X4| | 15 求用雅可比迭代法和高斯-赛德尔迭代法求线性方程组的C语言程序1 -2 2 x1 -12-1 1 -1 x2 = 0-2 -2 1 x3 10 用牛顿迭代法能求一元n次方程的所有根么比如说一元三次方程,三个根不同,用牛顿迭代法只能求出其中一个实根,另外两个根怎么求?如果有复根呢?能不能求?但迭代法求出的是数值解,而且有 用迭代法求平方根