I have a vector $A=\{1,2,3,4,5,6\}$, and I want to define a function of $A$ as
f[A_]:=A.X
where $X$ is another vector. I want to define this function without fully specifying the components of $A$, but Mathematica does not recognize this, so I have to write
f[A1_,A2_,A3_,A4_,_A5_,A6_]:= {A1,A2,A3,A4,A5,A6}.X
where $Ai, i=1,...,6$ are equal to 1 to 6, respectively. The second method is not very convenient. So, I was wondering how I can use my first code so that Mathematica recognizes that. Many thanks!
It should be noted that this is not a duplicate of Can a function be made to accept a variable amount of inputs?, because the question you referred to asked about "how to accommodate varying number of inputs in a function", however, my question is about how to change the representation of vector (based on its fixed components) in a function.
f[A_] := A.X
seems to work fine. For instance, withX = {1, 3, 5, 7, 9, 11}
,f[{1, 2, 3, 4, 5, 6}]
yields161
.. $\endgroup$