multiply

x * y

multiply(x, y)

Try it yourself:

See also:

Multiply numbers, vectors, and matrices

multiply performs multiplication with behavior appropriate to its operands. For scalars it returns a product; for matrices it performs matrix multiplication when dimensions are compatible.

Matrix meaning

A 2-by-3 matrix can multiply a 3-by-1 vector, producing a 2-by-1 result. Check dimensions with size. Use dotMultiply for elementwise multiplication and dot for a vector dot product.

Caveats

Matrix multiplication is not commutative: A×B usually differs from B×A. Use identity for the multiplicative neutral matrix and ctranspose in complex linear algebra. Type and shape mismatches should be fixed explicitly, not hidden by flattening.

Try Multiply in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions