下面的A*(A\D)
的结果怎么可能不等于D
?线性方程的错误解法,或为什么A *(A B)不等于B?
它应该产生D
- 这里是八度文档的摘录:
Systems of linear equations are ubiquitous in numerical analysis. To solve the set of linear equations Ax = b, use the left division operator, ‘\’: x = A \ b
下面是为那些谁想要尝试它的代码:
A = [1,1,1;0,0,0;2,1,2;2,1,2;3,5,6]
D = [1;2;3;4;5]
% A is of rank 3:
rank(A)
% therefore the system Ax=D has a unique solution
x = A\D
% but Octave has not given the good solution:
A*x
有人说我的Matlab产生完全相同的结果。
编辑2012年10月10日:看了答案后,让我地步,我做了一个严重的错误:索赔“A的秩是3,因此该系统斧= d有一个独特的解决方案”是绝对错误的!顺便说一下,上面显示的文档相当令人不安。
为什么要'A *(A \ d)'是一样的'D'? – phimuemue
@phimuemue因为这正是左分区操作符的目标。我编辑了我的帖子,添加了关于此运算符的文档内容。 –