MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [求助]求解方程,为什么得不出所要的结果 (https://www.labfans.com/bbs/showthread.php?t=4670)

rha 2008-09-29 10:48

[求助]求解方程,为什么得不出所要的结果
 
我按照一本教材上的例子
A=[1 2 3;4 5 6;7 8 9]
y=[23;50;77]
求解x
按照x=inv(A)*y
或者x=A\y
求解,matlab都显示如下:
>> x=inv(A)*y
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 1.541976e-018.
x =
0
0
0
>> x=A\y
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 1.541976e-018.
x =
-29
62
-24

这是什么原因,正确答案应该是[1 2 6]'呀。

xxhs 2008-09-29 13:04

回复: [求助]求解方程,为什么得不出所要的结果
 
呵呵,我也在学,不过就看到一点说是A要非奇异,很久没复习线代了,至于什么是奇异忘了,
你自己在翻翻书吧。

meteora1005 2008-09-29 20:30

回复: [求助]求解方程,为什么得不出所要的结果
 
A的行列式为零A就是奇异矩阵了,同时A的条件数也相当大说明A是高度病态矩阵,这是用A进行计算基本上是无解的或很不准确的


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

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