Function to generate a Dirichlet matrix