UNPKG

mathjs

Version:

Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif

47 lines (29 loc) 1.08 kB
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> # Function dotMultiply Multiply two matrices element wise. The function accepts both matrices and scalar values. ## Syntax ```js math.dotMultiply(x, y) ``` ### Parameters Parameter | Type | Description --------- | ---- | ----------- `x` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Left hand value `y` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Right hand value ### Returns Type | Description ---- | ----------- number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Multiplication of `x` and `y` ## Examples ```js 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]] ``` ## See also [multiply](multiply.md), [divide](divide.md), [dotDivide](dotDivide.md)