def setbound(V, Vbool, t, b, l, r):
    """
    Function to set te boundary conditions of the plane.

    Parameters
    ----------
    V : np.array
        Matrix of V initial values.
    Vbool : np.array
        Matrix of U boolean values, 1 if the cell is inside an object and 0
        otherwise.
    t : array
        Top boundary condition.
    b : array
        Bottom boundary condition.
    l : array
        Left boundary condition.
    r : array
        Right boundary condition.

    Raises
    ------
    ValueError
        Error if the dimensions of the conditions lists do not coincide with
        the dimensions of the matrix.

    Returns
    -------
    None.

    """
    if (len(t) != len(V[0])) or (len(b) != len(V[0])):
        raise ValueError('Top and bottom conditions must have the same dimen'
                         'sions that Ux.')
    if (len(l) != len(V[:,0])) or (len(r) != len(V[:,0])):
        raise ValueError('Left and right conditions must have the same dimen'
                         'sions that Uy.')
    Vbool[0,:] = True
    Vbool[-1,:] = True
    Vbool[:,0] = True
    Vbool[:,-1] = True
    
    V[0,:] = b
    V[-1,:] = t
    V[:,0] = l
    V[:,-1] = r
    
    return None