MATLAB: Find 1’s each Row

matrix column row

I have an easy question;
I have a matrix ( x row, x columns) filled with 0s and 1s.
I want to check if there is a 1 in every row (for every column).
then result that in a new matrix
so basically it is this
0 0 0 = 0
1 0 0 = 1
0 1 0 = 1
0 0 1 = 1

Best Answer

oneInColumn = any(yourMatrix, 2);