(Solved) : 4 Value Pi Calculated Series Write Matlab Function Calculate Value P Using First N Terms S Q44075074 . . .
4. The value of pi can be calculated with the series: Write a Matlab function to calculate the value of p by using the first n terms of the series, and calculate the true relative error for each n. (For a true value of p in a and b, use the predefined Matlab variable pi). a) Write a Matlab script that utilizes the function to calculate the approximate value of pi for several n values. The script should use n = 1, 3, 7, 10, 25, 50, 100, 200, and 8000, and also calculate the relative true error. The script should print the results to the screen when run. b) Write a script to plot the relative true error as a function of n. You may use a single script to perform both parts a) and b).] Show transcribed image text 4. The value of pi can be calculated with the series: Write a Matlab function to calculate the value of p by using the first n terms of the series, and calculate the true relative error for each n. (For a true value of p in a and b, use the predefined Matlab variable pi). a) Write a Matlab script that utilizes the function to calculate the approximate value of pi for several n values. The script should use n = 1, 3, 7, 10, 25, 50, 100, 200, and 8000, and also calculate the relative true error. The script should print the results to the screen when run. b) Write a script to plot the relative true error as a function of n. You may use a single script to perform both parts a) and b).]
Expert Answer
Answer to 4. The value of pi can be calculated with the series: Write a Matlab function to calculate the value of p by using the f…
OR