Documentation/How Tos/Calc: MMULT function

From Apache OpenOffice Wiki
Jump to: navigation, search


MMULT

Returns the ordinary product of two matrices.

Syntax:

MMULT(array1; array2)

multiplies array1 and array2, and returns the matrix result. array1 and array2 may each be either an inline array or a range, containing all numbers.
The number of columns in array1 must be the same as the number of rows in array2.
MMULT returns an array with the same number of rows as array1 and the same number of columns as array2. MMULT must be entered as an array formula (for example by using Cntrl-Shift-Enter rather than just Enter).

Example:

=MMULT({1;2;3};{4;5|6;7|8;9})

when entered as an array formula in cell B3, returns 40 in cell B3 and 46 in cell C3. A 1 x 3 matrix was multiplied by a 3 x 2 matrix, giving a 1 x 2 matrix result, calculated as 1*4 + 2*6 + 3*8 = 40 and 1*5 + 2*7 + 3*9 = 46.



See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_MMULT_function&oldid=243434"
Views
Personal tools
Navigation
Tools