need helpin solving this.
18 次查看(过去 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!