For loop summation/ limit

3 ビュー (過去 30 日間)
Thomas Holmes
Thomas Holmes 2019 年 3 月 25 日
コメント済み: Walter Roberson 2019 年 3 月 26 日
I am trying to write a script that computes (4N^2)/((4N^2)-1) for N = 10, 100, 1000, 10000. Then use the results to estimate the limit. This is the script I have. I know something is wrong because for N=10 the result is 2.0507. Any tips or troubleshooting would be appreaciated
y=2;
N=10;
for i=1:N
y=y*((4*N^2)/((4*N^2)-1))
end
y
  2 件のコメント
Star Strider
Star Strider 2019 年 3 月 26 日
What series are you intending to code?
What is the result supposed to be for 10, 100, 1000, 10000 ... ?
Walter Roberson
Walter Roberson 2019 年 3 月 26 日
Your title mentions summation, but your code has product ?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by