为什么 Matlab 的 inv 慢且不准确? [英] Why is Matlab's inv slow and inaccurate?

查看:36
本文介绍了为什么 Matlab 的 inv 慢且不准确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在几个地方读过(在文档和这篇博文中:http://blogs.mathworks.com/loren/2007/05/16/purpose-of-inv/ ) 不推荐在 Matlab 中使用 inv,因为它速度慢且不准确.

I read at a few places (in the doc and in this blog post : http://blogs.mathworks.com/loren/2007/05/16/purpose-of-inv/ ) that the use of inv in Matlab is not recommended because it is slow and inaccurate.

我正在尝试找出这种不准确的原因.到目前为止,谷歌没有给出有趣的结果,所以我认为这里有人可以指导我.

I am trying to find the reason of this inaccuracy. As of now, Google did not give m interesting result, so I thought someone here could guide me.

谢谢!

推荐答案

我提到的不准确在于方法 INV,而不是 MATLAB 对它的实现.您应该使用 QR、LU 或其他方法来求解方程组,因为这些方法通常不需要对相关系统的条件数进行平方.使用 inv 通常需要对原始系统的条件数进行平方而失去准确性的操作.

The inaccuracy I mentioned is with the method INV, not MATLAB's implementation of it. You should be using QR, LU, or other methods to solve systems of equations since these methods don't typically require squaring the condition number of the system in question. Using inv typically requires an operation that loses accuracy by squaring the condition number of the original system.

--罗兰

这篇关于为什么 Matlab 的 inv 慢且不准确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆