矩陣乘法計算機

矩陣乘法計算機

新興 AI Skill PRO

輸入計算

數學公式

(A11A12A21A22)(B11B12B21B22)=(C11C12C21C22)其中{C11=A11B11+A12B21C12=A11B12+A12B22C21=A21B11+A22B21C22=A21B12+A22B22\begin{gathered} \begin{pmatrix} {{\text{A}_{11}}} & {{\text{A}_{12}}} \\ {{\text{A}_{21}}} & {{\text{A}_{22}}} \end{pmatrix} \begin{pmatrix} {{\text{B}_{11}}} & {{\text{B}_{12}}} \\ {{\text{B}_{21}}} & {{\text{B}_{22}}} \end{pmatrix} = \begin{pmatrix} C_{11} & C_{12} \\ C_{21} & C_{22} \end{pmatrix} \\[1.5em] \text{其中}\quad \left\{ \begin{aligned} C_{11} &= {{\text{A}_{11}}}\,{{\text{B}_{11}}} + {{\text{A}_{12}}}\,{{\text{B}_{21}}} \\ C_{12} &= {{\text{A}_{11}}}\,{{\text{B}_{12}}} + {{\text{A}_{12}}}\,{{\text{B}_{22}}} \\ C_{21} &= {{\text{A}_{21}}}\,{{\text{B}_{11}}} + {{\text{A}_{22}}}\,{{\text{B}_{21}}} \\ C_{22} &= {{\text{A}_{21}}}\,{{\text{B}_{12}}} + {{\text{A}_{22}}}\,{{\text{B}_{22}}} \end{aligned} \right. \end{gathered}
使用統計

廣告

結果

乘積矩陣 AB
19
22
43
50
2×2 結果矩陣
C₁₁ 19
C₁₂ 22
C₂₁ 43
C₂₂ 50

回報本頁錯誤

什麼是矩陣乘法?

矩陣乘法是把兩個矩陣結合成單一乘積矩陣的運算。以兩個 2×2 矩陣 A 與 B 為例,乘積 AB 同樣是一個 2×2 矩陣,其中每一個元素都是以 A 的某一「列」對應 B 的某一「行」逐項相乘後再加總而得,也就是所謂「列乘行」的內積法則。這個計算機專門處理線性代數、電腦圖學與物理中最常見的 2×2 情境。

如何使用本計算機

先輸入矩陣 A 的四個數值(A₁₁、A₁₂、A₂₁、A₂₂),再輸入矩陣 B 的四個數值(B₁₁、B₁₂、B₂₁、B₂₂)。按下計算後,工具便會回傳完整的 2×2 乘積矩陣 AB。小數與負數皆完全支援。

公式說明

一般通則為 \((AB)_{ij} = \sum_{k} A_{ik} \times B_{kj}\)。對 2×2 矩陣而言,可展開成下列四條算式:

$$\left\{ \begin{aligned} C_{11} &= A_{11}B_{11} + A_{12}B_{21} \\ C_{12} &= A_{11}B_{12} + A_{12}B_{22} \\ C_{21} &= A_{21}B_{11} + A_{22}B_{21} \\ C_{22} &= A_{21}B_{12} + A_{22}B_{22} \end{aligned} \right.$$

請特別注意:矩陣乘法一般不具交換律,在多數情況下 \(AB \neq BA\)。

廣告
2×2 矩陣乘法中的列乘行點積
乘積中的每個元素都由 A 的一列與 B 的一行組合而成。

範例演算

設 \(A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\),\(B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}\)。

$$\begin{aligned} C_{11} &= 1 \times 5 + 2 \times 7 = 5 + 14 = \textbf{19} \\ C_{12} &= 1 \times 6 + 2 \times 8 = 6 + 16 = \textbf{22} \\ C_{21} &= 3 \times 5 + 4 \times 7 = 15 + 28 = \textbf{43} \\ C_{22} &= 3 \times 6 + 4 \times 8 = 18 + 32 = \textbf{50} \end{aligned}$$

因此 \(AB = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}\)。

兩個 2×2 矩陣相乘得到乘積矩陣的詳解範例
2×2 乘法詳解:結果中的每個格子都是兩個乘積之和。

常見問題

矩陣乘法具有交換律嗎?沒有。一般而言 \(AB \neq BA\),所以矩陣的前後順序很重要。

哪些尺寸的矩陣可以相乘?A 的「行數(直行數)」必須等於 B 的「列數(橫列數)」。本工具專注於 2×2 乘以 2×2 的運算,結果必定也是 2×2 矩陣。

可以輸入負數或小數嗎?可以。任何實數都接受,包含負數與小數。

最後更新:

數學和統計熱門計算器

查看全部數學和統計計算器