Please show me how to code this problem using MatLab. Also, I am a beginning pro
ID: 3880397 • Letter: P
Question
Please show me how to code this problem using MatLab. Also, I am a beginning programmer so I do not know much so try and explain if possible
Problem A) The value of can be estimated by evaluating a partial sum of the form =4( + +.. Write a script named approxPi.m which computes the first million terms of this series. Then use eumeum to compute the partial sums (as was done in the sample solutions from lecture). As a final result, calculate the relative error between MATLAB's pi and our approximate pi for partial sums with N 10, 100, 1000, 10000, 100000, 1000000 number of terms. Store these results in a vector called errorePi oriliExplanation / Answer
Here is the code, do comment if you have any doubts. Thumbs up if this helps!
N=1000000;
f=@(x) 4*((-1).^x)/(2.*x+1);
pi_1=f(0:N);
Value of N can be changed as required.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.