I'm having a binary MxN matrix like the following:
matrix([[0, 0, 0, ..., 0, 0, 0],
[0, 1, 0, ..., 0, 0, 0],
[0, 0, 1, ..., 0, 0, 0],
...,
[0, 0, 0, ..., 1, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 1]])
How can I convert this matrix row-wise to the integer representation? The goal is to get a Mx1 matrix. Each row contains the integer representation of the previous binary row.