sureshverm_1289 asked . 10/09/2018

How do I multiply 3x3 matrices in MATLAB?

How do I multiply 3x3 matrices in MATLAB?

Matlab

Expert Answer

Kshitij Singh ( Staff ) answered . 15/09/2018


MATLAB Matrix Multiplication
Create a script file with the following code −
Live Demo

a = [ 1 2 3; 2 3 4; 1 2 5]
b = [ 2 1 3 ; 5 0 -2; 2 3 -1]
prod = a * b
When you run the file, it displays the following result −
a =
1 2 3
2 3 4
1 2 5
b =
2 1 3
5 0 -2
2 3 -1
prod =
18 10 -4
27 14 -4
22 16 -6