Skip to content

mtimes

Matrix multiplication (A * B).

C = mtimes(A, B)

Returns the matrix product A * B. The number of columns of A must equal the number of rows of B. For scalar A or B, this is elementwise multiplication. Same as the * operator on matrices.

For elementwise array multiplication, use .* or times.

A = [1 2; 3 4]; B = [5 6; 7 8];
A * B % [19 22; 43 50]
mtimes(A, B) % same
  • mrdivide — Matrix right division (A / B).
  • mldivide — Matrix left division (A \ B).
  • mpower — Matrix power (A ^ B).
  • dot — Vector or array dot product.