Magnetoelectric effect in functionalized few-layer graphene