$a_{ij}$ and $b_{ij}$ elements of matrix A and B (same dimensions).
I want to multiply the matrices element-wise so the resulting matrix $s$ have the same dimensions as A and B. Is this the correct way to express the mathematical operation?
And are they the same?
\begin{equation}
s = \sum_{i}^n \sum_{j}^n w_{ij} a_{ij}
\label{eq:observert}
\end{equation}
\begin{equation}
s = w_{ij} \odot a_{ij}
\label{eq:hadamard}
\end{equation}
Best Answer
The first identity gives you a scalar, not a matrix
The Hadamard product of matrices $A$ and $B$ is usually denoted as $A\odot B$ and the element of $A\odot B$ is given by $$ (A\odot B)_{ij}=(A)_{ij}(B)_{ij} $$