Generate a Python function to generate an equation with given coefficients and variables.
coefficients: [2, 3, 1], variables: ["x", "y", "z"]
def generate_equation(coefficients, variables):
 equation = ""
 for i, coeff in enumerate(coefficients):
  equation += str(coeff) + variables[i] + " + "
 equation = equation[:-3]
 return equation