To compute the array-product of two matrices a
and b
means to multiply each corresponding element in a
with the corresponding element in b
. In MATLAB, we can perform array multiplication using element-wise multiplication with the .*
operator.
To compute the matrix-product of two matrices a
and b
means to multiply the rows of a
with the columns of b
. In MATLAB, we can perform matrix multiplication using the *
operator.
Here is the code to compute the array-product and matrix-product of the given matrices in MATLAB:
main.m185 chars9 lines
Output:
main.m151 chars13 lines
gistlibby LogSnag