필터 지우기
필터 지우기

sums with for loop

조회 수: 3 (최근 30일)
Alonso Mukendi Kalonji
Alonso Mukendi Kalonji 2022년 10월 29일
댓글: Alonso Mukendi Kalonji 2022년 10월 30일
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

채택된 답변

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by