Taylor series while loop

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by