def set_off_diagonal_to_zero(matrix):
    """Sets the off-diagonal elements of a matrix
    """
    for i in range(matrix.shape[0]):
        for j in range(matrix.shape[1]):
            if i != j:
                matrix[i, j] = 0
    return matrix