Previous Up Next

2.42.9  Hadamard product (infixed version): .*

.* takes as arguments two matrices or two lists A and B of the same size.
.* is an infixed operator that returns the matrix or the list where each term is the term by term product of the corresponding terms of A and B.
Input :

[[1, 2],[3,4]] .* [[5, 6],[7, 8]]

Output :

[[5,12],[21,32]]

Input :

[1,2,3,4] .* [5,6,7,8]

Output :

[5,12,21,32]

Previous Up Next