Taylor series while loop

4 ビュー (過去 30 日間)
George  Zimbodia
George Zimbodia 2014 年 9 月 24 日
コメント済み: George Zimbodia 2014 年 9 月 25 日
Thanks for the help!

採用された回答

Guillaume
Guillaume 2014 年 9 月 24 日
You code is quite good. You made three error:
  • the sign of term must change at each iteration
  • in term again, the power of x is odd (2*k+1)
term = (-1)^k * x^(2*k+1)/factorial(2*k+1);
  • Pn is the result you're calculating. It's what you want to display, not term.
  1 件のコメント
George  Zimbodia
George Zimbodia 2014 年 9 月 25 日
Thank you! and I forgot to change the disp(term) to disp(Pn) on my original question even though I had did so on my code!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by