如何在 Excel 中求解线性方程组

发布于 2024-09-18 00:13:46 字数 286 浏览 3 评论 0原文

我在使用 Excel 寻找方程组的解时遇到一些问题。
该系统的形式为 Ax=b,其中 A 为矩阵以及 xb 向量。显然,目标是找到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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清风挽心 2024-09-25 00:13:46

您可以使用 pseudoinverse 和 Excel 的矩阵函数。假设有一个命名范围 _A 包含您的矩阵,另一个命名范围 _b 包含您的向量,那么您可以选择一组适当形状的单元格并输入公式:

=MMULT((MINVERSE(MMULT(TRANSPOSE(_A); _A))); MMULT(TRANSPOSE(_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:

=MMULT((MINVERSE(MMULT(TRANSPOSE(_A); _A))); MMULT(TRANSPOSE(_A); _b))

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文