3
$\begingroup$

I have a list as

list={{-0.5, 5}, {-0.25, 2}, {0, 3}, {0.25, 2}, {0.5, 5}}

and I want to use of Esc+sum+Esc symbol for summation in this format: enter image description here

I mean this summation:

5*ee^-0.5x + 2*ee^-0.25x + 3 + ....

However we can use of sum but I mean Is it possible to use of constrains in lower limit and upper limit in the summation symbol?

$\endgroup$
0

1 Answer 1

4
$\begingroup$

The Mathematica way is to write

Total[#2 Exp[# x] & @@@ list]

enter image description here

The same with the part of the list:

Total[#2 Exp[# x] & @@@ list[[2 ;; 4]]]

enter image description here

Also you can write an explicit sum with EscsumtEsc:

enter image description here

$\endgroup$
4
  • $\begingroup$ Wonderful and enjoyable, $\endgroup$ Commented Nov 11, 2015 at 19:52
  • $\begingroup$ As well as we can use of Dimensions[list][[1]] to upper limit of summation in the general case $\endgroup$ Commented Nov 11, 2015 at 20:11
  • $\begingroup$ @Bstates It is equivalent to Length[list] $\endgroup$
    – ybeltukov
    Commented Nov 11, 2015 at 20:46
  • $\begingroup$ Yes, Completely true $\endgroup$ Commented Nov 12, 2015 at 4:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.