generate a summation series
古いコメントを表示
3(2+1)+4(3+2+1)+5(4+3+2+1)+6(5+...1)+...+1000(999+...+1).
How to write a matlab code to calculate the following summation without using for loop?
i can see the trend for 3(2+1) if the n = 1 (n+2)[((n+2)-1)+((n+2)-2)].
Assume the summation only sum until 6th term.
can we use array to solve this?
2 件のコメント
ibraheem kanai
2021 年 6 月 5 日

Walter Roberson
2021 年 6 月 5 日
編集済み: Walter Roberson
2021 年 6 月 12 日
採用された回答
その他の回答 (1 件)
Walter Roberson
2015 年 8 月 13 日
0 投票
It does have a symbolic answer that you could find using nested symsum() if you have the symbolic toolbox.
But for a numeric answer: cumsum() and multiply by something gives a bunch of terms...
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!