I have a function that extracts a numerical value from two vectors, written as Spa[i_,j_]:=Flatten[LaU[i].LaD[j]][[1]]
. (Note, I'm sure that this isn't the most efficient way to solve this problem but it works for my uses). In the next stage of my process, I'm having to calculate Spa functions when the argument needs something other than LaU
, like something called QLaU[1]
, which is defined in a similar process (exact same dimensions etc).
Instead of manually creating a separate function like e.g SpaQ[i_,j_] :=Flatten[QLaU[1].LaD[2]][[1]]
, I'm hoping to use a Module
function to simply combine the two together, and have MMA recognise the type of function. Is this possible within the scope of Module
? I'm essentially trying to put a couple of functions within the single overall Spa
function, to keep the final results looking similar.
Spa[lau_,i_,j_]:=Flatten[lau[i].LaD[j]][[1]]
? $\endgroup$LaU
orQLaU
as an argument toSpa
. That is what Alan is implying in his comment. $\endgroup$