在MATLAB中用求解高斯—塞德尔迭代法线性方程组
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/23 02:20:33
在MATLAB中用求解高斯—塞德尔迭代法线性方程组
function x=Gauss_Seidel(A,b,x0,tol)
if (nargin==2)
x0=ones(size(b));
tol=1e-6;
elseif (nargin==3)
tol=1e-6;
else
sprintf('USAGE:Gauss_Seidel(A,b,x0,tol)')
end
D=diag(diag(A));
U=triu(A,1);
L=tril(A,-1);
G=-(D+L)\U;
d1=(D+L)\b;
x=G*x0+d1;
n=1;
while norm(x-x0)>=tol
x0=x;
x=G*x0+d1;
n=n+1;
end
n
if (nargin==2)
x0=ones(size(b));
tol=1e-6;
elseif (nargin==3)
tol=1e-6;
else
sprintf('USAGE:Gauss_Seidel(A,b,x0,tol)')
end
D=diag(diag(A));
U=triu(A,1);
L=tril(A,-1);
G=-(D+L)\U;
d1=(D+L)\b;
x=G*x0+d1;
n=1;
while norm(x-x0)>=tol
x0=x;
x=G*x0+d1;
n=n+1;
end
n
在MATLAB中用求解高斯—塞德尔迭代法线性方程组
在MATLAB中用求解高斯—塞德尔迭代法线性方程组程序
给定以下线性方程组,用雅可比迭代法和高斯-塞德尔迭代法是否收敛?
求解线性方程组的预处理迭代法
在MATLAB中用LU分解法求解下述线性方程组,并写出相应矩阵分解中的矩阵L、U
在matlab中用newton迭代法求解x-sinx=0根,急求,马上交作业了,谢谢高手来解答!
求用雅可比迭代法和高斯-赛德尔迭代法求线性方程组的C语言程序
Matlab 求解非齐次线性方程组
matlab 求解线性方程组出错
符号线性方程组matlab求解
matlab 线性方程组求解
MATLAB求解线性方程组