How can I do the multiple summation ??

Hi, I have a problem that I have no idea to do it. Anyone could help me please? How can I write the code for the multiple summation when the number of summation is a variable. Actually, the summation can be from 0 to a number, say 100. Any help is very appreciated.

回答 (1 件)

Mark Fajet
Mark Fajet 2017 年 6 月 28 日

1 投票

Hello. It seems like you're asking about how to take the sum of a series. If you look at the documentation for symsum found at https://www.mathworks.com/help/symbolic/symsum.html, you might find what you're looking for. As a simple example,
syms k x
S1 = symsum(k*x, k, 0, 10)
S2 = symsum(S1,x,0,10)
or more concisely,
syms k x
S = symsum(symsum(k*x, k, 0, 10),x,0,10)
These will take the sum of k * x as x goes from 0 to 10 and take the sum of x * the result of that sum as x goes from 0 to 10. Refer to the linked documentation for more specifics and exmaples on how the symsum function is defined and used.

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

質問済み:

2017 年 6 月 28 日

回答済み:

2017 年 6 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by