simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

dotMultiply.md (1133B)


      1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
      2 
      3 # Function dotMultiply
      4 
      5 Multiply two matrices element wise. The function accepts both matrices and
      6 scalar values.
      7 
      8 
      9 ## Syntax
     10 
     11 ```js
     12 math.dotMultiply(x, y)
     13 ```
     14 
     15 ### Parameters
     16 
     17 Parameter | Type | Description
     18 --------- | ---- | -----------
     19 `x` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Left hand value
     20 `y` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Right hand value
     21 
     22 ### Returns
     23 
     24 Type | Description
     25 ---- | -----------
     26 number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Multiplication of `x` and `y`
     27 
     28 
     29 ### Throws
     30 
     31 Type | Description
     32 ---- | -----------
     33 
     34 
     35 ## Examples
     36 
     37 ```js
     38 math.dotMultiply(2, 4) // returns 8
     39 
     40 a = [[9, 5], [6, 1]]
     41 b = [[3, 2], [5, 2]]
     42 
     43 math.dotMultiply(a, b) // returns [[27, 10], [30, 2]]
     44 math.multiply(a, b)    // returns [[52, 28], [23, 14]]
     45 ```
     46 
     47 
     48 ## See also
     49 
     50 [multiply](multiply.md),
     51 [divide](divide.md),
     52 [dotDivide](dotDivide.md)