The Hilbert function of some Hadamard products