| 11 | 1/1 | 返回列表 |
| 查看: 3404 | 回復(fù): 10 | |||
mathstudy金蟲 (正式寫手)
|
[交流]
matlab 求解線性方程組Ax=b
|
||
| x=inv(A)*b;和x=A\b;和迭代法 有什么區(qū)別? 前面兩個求 A逆 的是基于什么? |
» 搶金幣啦!回帖就可以得到:
+1/471
+4/228
+1/87
+1/77
+2/48
+1/27
+1/21
+1/17
+1/15
+1/14
+1/11
+1/9
+1/8
+1/7
+1/5
+1/2
+1/2
+1/2
+1/1
+1/1
|
我大致看了一下matlab help,A\b 根據(jù)A的情況用到幾種不同的算法,如果A是一個方陣,b是一個列向量,此時Ax=b就是你說的線性方程組,\用的算法就是Gauss消去法;如果A不是方陣,那么Ax=b就是一個矩陣方程,其實這時候精確解不一定存在,matlab中的\就用了最小二乘法的思想求了一個近似的x(也可稱為廣義解),算法是QR分解。 可以這個簡單理解,inv(A)*b是A\b的一種特殊情況(線性方程組時),但是A\b更強大,可以求出廣義解。 在計算線性方程組Ax=b時,inv(A)*b和A\b用的數(shù)值算法都是Gauss消去法。至于你說的效率,A\b由于考慮的情況比較龐大,調(diào)用的時候稍微會慢一點,我不認(rèn)為有質(zhì)的區(qū)別。 |
榮譽版主 (文壇精英)
![]() |
專家經(jīng)驗: +518 |
金蟲 (正式寫手)
金蟲 (正式寫手)
金蟲 (正式寫手)
金蟲 (正式寫手)
|
It takes almost two and one half times as long to compute the solution with y = inv(A)*b as with z = A\b. Both produce computed solutions with about the same error, 1.e-6, reflecting the condition number of the matrix. But the size of the residuals, obtained by plugging the computed solution back into the original equations, differs by several orders of magnitude. The direct solution produces residuals on the order of the machine accuracy, even though the system is badly conditioned. The behavior of this example is typical. Using A\b instead of inv(A)*b is two to three times as fast and produces residuals on the order of machine accuracy, relative to the magnitude of the data. |
| 11 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 0703化學(xué)調(diào)劑 ,六級已過,有科研經(jīng)歷 +8 | 曦熙兮 2026-03-15 | 8/400 |
|
|---|---|---|---|---|
|
[考研] 268求調(diào)劑 +7 | 好運連綿不絕 2026-03-12 | 8/400 |
|
|
[考研] 301求調(diào)劑 +5 | yy要上岸呀 2026-03-17 | 5/250 |
|
|
[考研] 考研化學(xué)學(xué)碩調(diào)劑,一志愿985 +4 | 張vvvv 2026-03-15 | 6/300 |
|
|
[考研] 有沒有道鐵/土木的想調(diào)劑南林,給自己招師弟中~ +3 | TqlXswl 2026-03-16 | 7/350 |
|
|
[考研] 267一志愿南京工業(yè)大學(xué)0817化工求調(diào)劑 +6 | SUICHILD 2026-03-12 | 6/300 |
|
|
[考研] 278求調(diào)劑 +3 | Yy7400 2026-03-13 | 3/150 |
|
|
[考研] 283求調(diào)劑 +10 | 小樓。 2026-03-12 | 14/700 |
|
|
[考研] 285求調(diào)劑 +6 | ytter 2026-03-12 | 6/300 |
|
|
[考研] 0703 物理化學(xué)調(diào)劑 +3 | 我可以上岸的對?/a> 2026-03-13 | 5/250 |
|
|
[考研] 材料專碩288分求調(diào)劑 一志愿211 +4 | 在家想你 2026-03-11 | 4/200 |
|
|
[考研] 0703,333分求調(diào)劑 一志愿鄭州大學(xué)-物理化學(xué) +3 | 李魔女斗篷 2026-03-11 | 3/150 |
|
|
[考研] 求材料調(diào)劑 +5 | 隔壁陳先生 2026-03-12 | 5/250 |
|
|
[考研] 一志愿西南交大,材料專碩317求調(diào)劑 +5 | lx8568 2026-03-11 | 5/250 |
|
|
[考研] 311求調(diào)劑 +3 | 冬十三 2026-03-13 | 3/150 |
|
|
[考研] 工科材料085601 279求調(diào)劑 +8 | 困于星晨 2026-03-12 | 10/500 |
|
|
[考研] 328化工專碩求調(diào)劑 +4 | 。,。,。,。i 2026-03-12 | 4/200 |
|
|
[論文投稿]
投稿問題
5+4
|
星光燦爛xt 2026-03-12 | 6/300 |
|
|
[考研] 277求調(diào)劑 +4 | anchor17 2026-03-12 | 4/200 |
|
|
[考研] 270求調(diào)劑 085600材料與化工專碩 +3 | YXCT 2026-03-11 | 3/150 |
|