Math Lab code?

3 Ansichten (letzte 30 Tage)
Marina Yanes
Marina Yanes am 28 Mär. 2022
Bearbeitet: Sam Chak am 28 Mär. 2022
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 Kommentare
KSSV
KSSV am 28 Mär. 2022
What have you attempted for your home work?
Sam Chak
Sam Chak am 28 Mär. 2022
Bearbeitet: Sam Chak am 28 Mär. 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

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by