Question: HW 2 - Q 3 ) MATLAB, PLEASE MAKE CODE COPYABLE Newton - Raphson Use the Newton - Raphson method to estimate the root after
HWQ MATLAB, PLEASE MAKE CODE COPYABLE
NewtonRaphson
Use the NewtonRaphson method to estimate the root after iterations for the function:
Use an initial guess of
a Save the answer from each iteration in a vector. You must use a loop and your single line
calculation must be performed by accessing the proper element in the vector and assigning
the result to the proper element in the same vector. For example, suppose you call the
vector Then the one line in the loop would be You will need
to determine what should replace the question mark and what should be inserted in the
blank.
So before the first iteration, you would have a vector after the first iteration,
and so forth
Display the vector as a column vector using the disp command. Make sure the values in
the vector are displayed in the long format. Make sure to change back to short afterwards!
b Calculate the exact real root using the roots function. Display using an fprintf
statement with digits to the right of the decimal point.
c In text, answer the question: "Why does the NewtonRaphson method initially overshoot
the exact value and then increase or decrease to converge to the exact value?"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
