Operator for matrix row sum

matrices

Let be a matrix $M$ with elements $m_{ij}$. I am interested in the row (or column) sum $\sum_j m_{ij}$. Is there any way to write this operation in a matrix form, using trace operators or the Kronecker product, etc?

Best Answer

Assume the order of matrix $M$ is $m\times n$, then $$\sum_{j=1}^n m_{ij}=\begin{bmatrix}0&\cdots&1&\cdots&0\end{bmatrix}M\begin{bmatrix}1\\1\\\vdots\\1\end{bmatrix}$$ where the row matrix is of order $1\times m$, only has a $1$ at its $i$-th position, and the column matrix is of order $n\times 1$.

Related Question