How to set every row in a matrix to required