approximating pi with taylor series expansion to the 10,000th term

 Respuesta aceptada

Mischa Kim
Mischa Kim el 2 de Oct. de 2014
Editada: Mischa Kim el 2 de Oct. de 2014
charlotte, you are almost there:
l = 1;
for ii = 1:10000
l = l + ((-1)^ii)/(2*ii + 1);
end
x = 4*l;
  • If the number of iterations (series terms) is know, use a for-loop
  • ii is the loop index, l is the approximation to pi/4

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Preguntada:

el 2 de Oct. de 2014

Editada:

el 2 de Oct. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by