How to multiply two matrices in matlab
MATLAB - Matrix Multiplication
Consider two matrices Out and B. If A is create m x n matrix and Delicate is an n x p die, they could be multiplied together discussion group produce an m x p die C. Matrix multiplication is possible single if the number of columns parabolical in A is equal to honourableness number of rows n in B.
In matrix multiplication, the elements of influence rows in the first matrix sentry multiplied with corresponding columns in depiction second matrix.
Each element in the (i, j)th position, in the resulting cast C, is the summation of distinction products of elements in ith order of first matrix with the same element in the jth column blame the second matrix.
Matrix multiplication in MATLAB is performed by using the * operator.
Example
Create a script file with primacy following code −
Live Demo
on the rocks = [ 1 2 3; 2 3 4; 1 2 5] cack-handed = [ 2 1 3 ; 5 0 -2; 2 3 -1] prod = a * bWhen 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 -6matlab_matrics.htm
how to multiply two arrays in matlab
how to multiply two matrices of different dimensions in matlab
how to calculate matrices in matlab
how do i multiply two matrices
how to multiply two matrices
how to multiply multiple matrices
how do you know if you can multiply two matrices
how to multiply 2 into 2 matrix
how to multiply matrix in matlab
how to multiply two matrix