scan rows of a matrix