函数 dotMultiply #

逐元素相乘两个矩阵。该函数接受矩阵和标量值。

Syntax #

math.dotMultiply(x, y)

Parameters #

Parameter Type Description
x number | BigNumber | Fraction | Complex | Unit | Array | Matrix 左值
y number | BigNumber | Fraction | Complex | Unit | Array | Matrix 右值

Returns #

Type Description
number | BigNumber | Fraction | Complex | Unit | Array | Matrix xy 的乘积

Throws #

Type | Description —- | ———–

Examples #

math.dotMultiply(2, 4) // returns 8

a = [[9, 5], [6, 1]]
b = [[3, 2], [5, 2]]

math.dotMultiply(a, b) // returns [[27, 10], [30, 2]]
math.multiply(a, b)    // returns [[52, 28], [23, 14]]

另请参阅 #

multiply, divide, dotDivide

Fork me on GitHub