need helpin solving this.
12 ビュー (過去 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.
Image Analyst
2013 年 1 月 2 日
Nope. n is a vector so you need ./ rather than /.
参考
カテゴリ
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!