如何在 Excel 中求解线性方程组
我在使用 Excel 寻找方程组的解时遇到一些问题。
该系统的形式为 Ax=b
,其中 A
为矩阵以及 x
和 b
向量。显然,目标是找到x。
该系统不一定具有相同数量的方程和未知数。精确的解决方案并不总是可能的。因此,我想找到最好的近似值,可能使用最小二乘法。
Excel 中有标准方法可以做到这一点吗?
如果没有,有人可以为我提供一个宏来实现这一点,或者解释我如何编写自己的宏吗?
谢谢
I am having some trouble finding a solution for a system of equations using excel.
The system is of the form Ax=b
, with A
a matrix and x
and b
vectors. Obviously, the goal is to find x.
The system does not necessarily have the same number of equations and unknowns. An exact solution is not always possible. Therefor I want to find the best approximation, possibly using least squares.
Are there standard methods in Excel to do that?
If not, can someone provide me with a macro that does that or explain how I can write my own?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查
LINEST()
函数< /a>.Check the
LINEST()
function.您可以使用 pseudoinverse 和 Excel 的矩阵函数。假设有一个命名范围
_A
包含您的矩阵,另一个命名范围_b
包含您的向量,那么您可以选择一组适当形状的单元格并输入公式:记住按 Control-Shift-Enter 键输入此公式,因为它是数组公式。当您选择单元格时,它周围会出现大括号。
You can use the pseudoinverse and Excel's matrix functions. Suppose there is a named range
_A
containing your matrix, and another named range_b
containing your vector, then you can select an appropriately shaped set of cells and enter the formula:Remember to press Control-Shift-Enter to enter this formula as it is an array formula. It will appear with braces around it when you select the cells.