Reputation: 11
I am generating lists of arguments of this sort:
list = {{i_1,min_1,max_1},{i_2,min_2,max_2}, ... ,{i_n,min_n,max_n}}
How can I use this kind of lists as an argument for the multiple Sum?
Sum[f,{i_1,min_1,max_1},{i_2,min_2,max_2}, ... ,{i_n,min_n,max_n}]
Upvotes: 1
Views: 1547
Reputation: 528
Sum
has attribute HoldAll
so you must force evaluation of Sequence
with Evaluate
.
list = {{i1, min1, max1}, {i2, min2, max2}, {in, minn, maxn}};
Sum[f, Evaluate[Sequence @@ list]]
You can't use underscore in Mathematica for variable names as it indicates a pattern.
Hope this helps.
Upvotes: 3