I have a list of variables variables={a,b} and a list with values values={1,2}. I'd like to define a function using the variables in variables like so:
f=Function[variables,2a+b];
Then, I'd like to call it in a way like
result=f@@values
or
result=f@@variables/.(Rule@@@Transpose@{variables,values})
or something similar.
Is there a way to create a function where the names of the variables are in a given list?