MATLAB Answers

In the first part of the code, plot the approximation of π as a function of N, the number of terms in the series, for N between 1 and 15. The function to be used is (pi^2-8)/1​6=Summatio​n(n=1:N)(1​/((2n-1)^2​*(2n+1)^2)​)

2 views (last 30 days)
Varun on 26 Oct 2013
Commented: Jie on 31 Oct 2013
I basically do not have any idea how to start. any help would be appreciated.
  1 Comment
Walter Roberson
Walter Roberson on 26 Oct 2013
How would you calculate the approximation of Pi if N is 1? How would you calculate it if N is 2? How would you plot the approximations?

Sign in to comment.

Answers (1)

Jie on 26 Oct 2013
Edited: Jie on 26 Oct 2013
wish this could help.
% the formula could be rewrote as pi=sqrt(sum(16/((2*n-1)^2*(2*n+1)^2)+8)
N=[1:15, 20, 30];
for n=N
my_pi=[my_pi, tmp];
figure;h=axes('color',[.5,.5,.9],'fontangle','italic','fontname','Times New Roman','xcolor',[0,0,.7]);hold on; grid on,
title('approcimation of \pi')

Community Treasure Hunt

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

Start Hunting!

Translated by