I am trying to generate a list of functions from a vector of expressions. I have the list
$H=[1,x,x^2+1,3x^3+2x,4x^2+2x]$ and I want to define a function $f$ using two inputs such that $f(n,x)$ returns the evaluation of the $n$th entry of $H$. For example, I want $f(3,y)=y^2+1$.
I tried this:
test[n_,y_]:=Module[
{func},
func[x_]:=Evaluate[Part[H,n]];
func[y]
].
However, it always return an expression of $x$ instead of the function output. Can anyone please help me?