Skip to content

Latest commit

 

History

History

MatrixMultiplication

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

矩陣乘法

矩陣乘法是在數值計算中相當基本的運算方式,矩陣乘法的效率常常也決定了數值軟體的效能。矩陣乘法中的每個元素計算依循以下式子:

測試

A = [1 2; 3 4]
B = [1, 0]
C = [1, 3]
@test all(multiply(A, B) .== C)

測試資料

以下測試資料中,請計算 AB 相乘,並比對正確答案 C

A1 = rand(5, 5)
B1 = rand(5, 5)
C1 = A1*B1

A2 = rand(1, 5)
B2 = rand(5, 1)
C2 = A2*B2

A3 = rand(3, 4)
B3 = rand(4, 5)
C3 = A3*B3