Can you help please?

6 Ansichten (letzte 30 Tage)
Konian Jean Philippe Lionnel Moro
Kommentiert: Walter Roberson am 15 Mai 2022
We want to solve x^3-4x+1=0 using Newton's method.
a) Graph f(x) = x^3-4x+1. Then choose 3 starting values to find the 3 solutions using Newton's method
b) Write a Matlab program of Newton's method to find the 3 solutions by question
c) Establish the table of errors En+1/En. What is the order of convergence for each solution ?
  6 Kommentare
Konian Jean Philippe Lionnel Moro
@Walter Roberson Write a Matlab program of Newton's method to find the 3 solutions per question
Walter Roberson
Walter Roberson am 14 Mai 2022
You posted code. What is the difference between the result of the code you posted, compared to what you want? Are you getting an error message?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Sam Chak
Sam Chak am 14 Mai 2022
Bearbeitet: Sam Chak am 14 Mai 2022
Please find out relevant info about Newton-Raphson method here, and see if helps you in writing the code and solving the problems.
Let us know your experience with MATLAB...

Weitere Antworten (1)

Konian Jean Philippe Lionnel Moro
@Walter Roberson Yes, "Enter the number of decimal places"
  1 Kommentar
Walter Roberson
Walter Roberson am 15 Mai 2022
I ran your code exactly as posted, using various inputs. It appears to execute without error for me, for any numeric scalar n and numeric scalar initial guess.
I do see that in the code, you do not use the value of n (decimal places) that you enter, but that does not lead to any error messages.
You should probably be calculating epsion in terms of n, instead of using a fixed epsilon.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by