I'm writing a function where I need to give many inputs. I created a list of variables from Table function.
My aim is to get
f[Subscript[x, 1],Subscript[x, 2],Subscript[x, 3]]
from table which i create
Table[Subscript[x, i], {i, 1, 3}]
What i need is
f @@ Blank /@ {Subscript[x, 1],
Subscript[x, 2], Subscript[x, 3],
Subscript[x, 4], Subscript[x, 5],
Subscript[x, 6], Subscript[x, 7],
Subscript[x, 8], Subscript[x, 9],
Subscript[x, 10]}
But that is not converting x to x_ . How to get that ?
f @@ (Pattern[#, Blank[]] & /@ {Subscript[x, 1], Subscript[x, 2], Subscript[x, 3], Subscript[x, 4], Subscript[x, 5], Subscript[x, 6], Subscript[x, 7], Subscript[x, 8], Subscript[x, 9], Subscript[x, 10]})
and see this q/a $\endgroup$symbols = Array[Symbol["x" <> ToString@#] &, 5]; ClearAll[f]; f[## & @@ (Pattern[#, Blank[]] & /@ symbols)] := Evaluate[Sin[Times @@ symbols]]; f[a, b, c, d, e]
$\endgroup$