need helpin solving this.
조회 수: 13 (최근 30일)
이전 댓글 표시
create a vector X with the elements,
add up the element of the version of this vector that has 100 elements.
thanks for the help.
n= 1:100
Xn= ((-1).^n+1)/(2*n-1)
Xn =
0.0076is this correct?
답변 (3개)
Sg dg
2013년 1월 2일
댓글 수: 2
Image Analyst
2013년 1월 2일
편집: Image Analyst
2013년 1월 2일
You go first. You can do this in two lines of MATLAB code. What were they and what were your "current answers"? Then we can tell you if you were correct.
Roger Stafford
2013년 1월 2일
As you near the end of your one hundred terms your sum ought to be oscillating roughly equal distances on either side of pi/4. Does that help?
Sg dg
2013년 1월 2일
댓글 수: 3
Walter Roberson
2013년 1월 2일
The "/" operator is for matrix division. You want ./ which is element-by-element division.
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!