Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need a code that I am able to run on MatLAB with no errors. The completed table, plot and MatLAB code is needed. Will
I need a code that I am able to run on MatLAB with no errors. The completed table, plot and MatLAB code is needed. Will give thumbs up for correct answers.
Problem3: Numerical Algorithm for Determining Roots The only mathematical operations the processor in a computing device (calculator, computer, cell phone, etc.) can perform are addition, subtraction, multiplication, and division. With this rather limited set of operations, how does your calculator (or Excel and MATLAB) determine values for more complicated mathematical operations such as: x". x!Je sin(x), cos(x), ln(x), e". atan(0) To calculate values for these functions, an iterative algorithm or a numerical method that only requires the basic arithmetic operations of addition, subtraction, multiplication, and division is needed. In this problem, you will look at a very simple algorithm for computing the cube root of a number based on the Newton-Raphson algorithm. The algorithm is very simple. We want to find Make an initial guess forxEst See how close you are Error- abs(EstA3-N) If the Error is too big, update the estimate as follows: Recalculate the Error using the new estimate Repeat this process to obtain a better guess Write a MATLAB script that does the following: 1. Prompts the user for the Number, N, for which he or she wishes to find the cube root 2. Prompt the user for the number of iterations he or she wishes to perform 3. Set the initial guess to 1 4. Uses the algorithm describe above to repeatedly update the estimate and error for the number of times specified by the uscr 5. Saves all the values for Est in a vector 6. Outputs the following: The final value of the estimate for the cube root of N to 4 decimal places The final Error to 4 decimal places A plot with all the values for Est on the y axis and the iteration value on the x axis Problem3: Numerical Algorithm for Determining Roots The only mathematical operations the processor in a computing device (calculator, computer, cell phone, etc.) can perform are addition, subtraction, multiplication, and division. With this rather limited set of operations, how does your calculator (or Excel and MATLAB) determine values for more complicated mathematical operations such as: x". x!Je sin(x), cos(x), ln(x), e". atan(0) To calculate values for these functions, an iterative algorithm or a numerical method that only requires the basic arithmetic operations of addition, subtraction, multiplication, and division is needed. In this problem, you will look at a very simple algorithm for computing the cube root of a number based on the Newton-Raphson algorithm. The algorithm is very simple. We want to find Make an initial guess forxEst See how close you are Error- abs(EstA3-N) If the Error is too big, update the estimate as follows: Recalculate the Error using the new estimate Repeat this process to obtain a better guess Write a MATLAB script that does the following: 1. Prompts the user for the Number, N, for which he or she wishes to find the cube root 2. Prompt the user for the number of iterations he or she wishes to perform 3. Set the initial guess to 1 4. Uses the algorithm describe above to repeatedly update the estimate and error for the number of times specified by the uscr 5. Saves all the values for Est in a vector 6. Outputs the following: The final value of the estimate for the cube root of N to 4 decimal places The final Error to 4 decimal places A plot with all the values for Est on the y axis and the iteration value on the x axis 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