To compute the matrix multiplication of two matrices a
and b
, use the *
operator in Matlab:
main.m11 chars2 lines
To compute element-wise multiplication of two matrices a
and b
, use the .*
operator in Matlab:
main.m12 chars2 lines
Note that element-wise multiplication requires both matrices to have the same dimensions, while matrix multiplication requires that the number of columns of the first matrix be equal to the number of rows of the second matrix.
gistlibby LogSnag