Math Lab code?
4 views (last 30 days)
Show older comments
Given the polynomial 
write a script that use Newton-Raphson method to determine the real root for the equation using an initial guess of x0 = 3.5 subject to the stopping condition of f(x0) <= 10-6.
Recall for Newton-Raphson method, the iterative algorithm is given by
x1 = x0 – f(x0)/fxp(x0)
where fxp stand for the derivative of f(x)
2 Comments
Sam Chak
on 28 Mar 2022
Edited: Sam Chak
on 28 Mar 2022
Is the root-finding problem related to your soccer field project?
It seemed like none of the THREE (3) suggested solutions in the Answers work for you because there is no feedback.
Anyhow, I think the polynomial function can be written like this:
function fx = func(x)
fx = x^3 - 5.75*x^2 + 8*x - 16;
Can you provide the derivative of
?
I think the stopping criteria can be written like this:
if abs(func(x)) <= 1e-6
break;
end
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!