Summation with FOR Loop
古いコメントを表示
Hello, Super noob question, but how do I do the attached picture in MatLab using a FOR loop. I just need to know how to set up the loop, not the actual values. Thanks for any help!

採用された回答
その他の回答 (3 件)
Jan
2017 年 4 月 17 日
0 投票
You cannot run a loop from 1 to infinity in Matlab. Either solve the summation symbolically or find out, if this sum converges and you can use a certain number of elements to get the result with a wanted accuracy.
Arzu Ahmadova
2019 年 5 月 22 日
0 投票
Hi,
Could you explain please how to code more than 2 different inifinite sums in loop?
daniel domshlak
2020 年 3 月 29 日
0 投票
i=0;
x = input ('choose the initial value : ');
y = input ('choose final value : ');
n=(x:y);
summe=0;
for i=x:y
a=(i*2+1).^3;
summe = summe + a;
end
summe
3 件のコメント
daniel domshlak
2020 年 3 月 29 日
not relevant to the qustion but I had an exersise to write a summation code not using sum function, and not found answears so i upload this.
daniel domshlak
2020 年 3 月 29 日
if someone finds a way to shorten this, don't hassitate to sahare.
Arzu Ahmadova
2020 年 3 月 29 日
Thanks
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!