Math Lab code?
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
Sam Chak
2022-3-28
编辑:Sam Chak
2022-3-28
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
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!