MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]Matlab报错了 (https://www.labfans.com/bbs/showthread.php?t=4944)

feng-wuyun 2008-10-21 20:54

[求助]Matlab报错了
 
function Gauss_Matrix(A,b,x0,Nmax,eps)
D=diag(diag(A));
U=-triu(A,1);
L=-tril(A,-1);
G=(D-L)\U;
f=(D-L)\b;
y=G*x0+f;
n=1;
while norm(y-x0)>=eps
x0=y;
y=G*x0+f;
n=n+1;
if n==Nmax
'bushoulian'
return
end
end
y
n
A=[8.714 2.180 5.684;-1.351 10.724 5.684;2.489 -0.459 6.799];
b=[49.91 50.77 32.68];
GaussSeidel(A,b,[0 0 0]',500,0.00001)
??? Error using ==> mldivide
Matrix dimensions must agree.

Error in ==> JacobiMatrix at 6
f=D\b;

laosam280 2008-11-08 00:03

回复:[求助]Matlab报错了
 
就是矩阵阶数计算的时候不统一

b的左除不对


所有时间均为北京时间。现在的时间是 03:16

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.