MMult 方法 (Excel) WorksheetFunctionWorksheetFunction.MMult method (Excel)

返回两数组的矩阵乘积。Returns the matrix product of two arrays. 结果矩阵的行数与 array1 的行数相同,矩阵的列数与 array2 的列数相同。The result is an array with the same number of rows as array1 and the same number of columns as array2.


表达式MMult(Arg1, Arg2)expression.MMult (Arg1, Arg2)

_表达式_一个代表**WorksheetFunction** 对象的变量。expression A variable that represents a WorksheetFunction object.


名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
Arg1-Arg2Arg1 - Arg2 必需Required VariantVariant Array1, array2 - 要进行矩阵乘法运算的两个数组。Array1, array2 - the arrays you want to multiply.

返回值Return value



Array1 的列数必须与 array2 的行数相同,而且两个数组中都只能包含数值。The number of columns in array1 must be the same as the number of rows in array2, and both arrays must contain only numbers.

Array1 和 array2 可以是单元格区域、数组常量或引用。Array1 and array2 can be given as cell ranges, array constants, or references.

MMult返回 #VALUE!MMult returns the #VALUE! 时出错:error when:

  • 任意单元格为空或包含文字。Any cells are empty or contain text.

  • array1 的列数与 array2 的行数不相等。The number of columns in array1 is different from the number of rows in array2.

  • 结果数组的容量等于或大于总计 5,461 个单元格。The size of the resulting array is equal to or greater than a total of 5,461 cells.

矩阵乘积_b_和__ _c_的矩阵乘积如下所示, 其中_i_是行号, _j_是列号:The matrix product array a of two arrays b and c is as follows, where i is the row number, and j is the column number:


对于返回结果为数组的公式,必须以数组公式的形式输入。Formulas that return arrays must be entered as array formulas.

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.