I am using Excel to do some dot product between two row vectors:
=MMULT(B1049:M1049, TRANSPOSE(B1050:M1050))
But it does not work, as the cell for the formula shows "#VALUE!". I wonder why? Thanks!
Note that all the cells in "B1049:M1049" and "B1050:M1050" are numbers.
PS: Is this question more suitable here or Superuser?
MMULT Excel Errors (Why is MMULT not working in Excel?)error will occur when the number of columns in array 1 (A below) is not the same as the number of rows in array2 (x below). What is this? To fix this would require that array x has three rows, so it probably means that one of the values from array x is missing.
For example, two vectors are v1 = [2, 3, 1, 7] and v2 = [3, 6, 1, 5]. The sum of the product of two vectors is 2 × 3 + 3 × 6 + 1 × 1 = 60. We can use the = SUMPRODUCT(Array1, Array2) function to calculate dot product in excel.
The MMULT function returns the matrix product of two arrays. The result is an array with the same number of rows as array1 and the same number of columns as array2.
probably simpler, you can just use =SUMPRODUCT(vec1,vec2). This is exactly the Euclidean inner product, without resorting to array formulas.
you need to enter MMULT
as an array formula, not as a standard formula
rather then hit enter when you type the formula in pres ctrl-shift-enter and excel will enter it as an array
it will end up looking like{=MMULT(B1049:M1049, TRANSPOSE(B1050:M1050))}
(please note you can't enter the {} manually)
You may want to look at Excel help which covers this well
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With