Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE READ BEFORE ANSWERING. This needs to BE IN MATLAB, not c++. l. The value of can be approximated by: 6 Write a script which
PLEASE READ BEFORE ANSWERING.
l. The value of can be approximated by: 6 Write a script which asks the user to input the number of iterations (n),then computes the expression, using a for loop to compute the summation with the spcified number of iterations. The larger the number of iterations, the closer the result should be to t. Print out the value of n, and the result using fprintf with 8 digits after the decimal to see the improved precision a. b. When your script is working, replace the input statement with afor loop, with a loop index, n, which goes from 1,000 to 10,000 in increments of 1,000. You will now have a loop inside a loop. This outer loop will set n, and your previous code, containing a loop for the summation, will compute pi for that value of n. Don't forget this outer loop's end statement. The result should be a line printed for each computation using a different value of n, something like: n 1000, approx- 3.14063806 n = 2000, approx = 3.14111527 Do not leave an input statement in your script- it will not publish This needs to BE IN MATLAB, not c++.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started