Borrar filtros
Borrar filtros

sums with for loop

3 visualizaciones (últimos 30 días)
Alonso Mukendi Kalonji
Alonso Mukendi Kalonji el 29 de Oct. de 2022
Comentada: Alonso Mukendi Kalonji el 30 de Oct. de 2022
I am beginner in matlab, and i struggly to resolve some exercice. can I have some advice according to this task?
1-1/3+1/5-1/7+1/9-..-1/1003

Respuesta aceptada

David Hill
David Hill el 29 de Oct. de 2022
n=1:502;
s=sum((-1).^(n+1)./(2*n-1))
s = 0.7849
  7 comentarios
Torsten
Torsten el 29 de Oct. de 2022
Maybe of interest:
syms n
s = simplify(symsum((-1)^n/(2*n+1),0,Inf))
s = 
Alonso Mukendi Kalonji
Alonso Mukendi Kalonji el 30 de Oct. de 2022
I get it!
Thank you very much!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Function Creation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by