setMatrixOffDiagonals function

set off-diagonal values of a matrix