How do I sum a series in Matlab without using a for loop?
Show older comments

The following is the code I've written to solve this series (chose an arbitrary N value of 10)
n=0:10
sum((4./(8.*n+1)-2./(8.*n+4)-1./(8.*n+5)-1./(8.*n+6)).*(1.^n)/(16.^n))
This series should ideally give a rough approximation of pi but I keep getting 2.1396e-15. I'm not sure what exactly Matlab is summing up.
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!