writing a script to find roots using Newton-Raphson Method in Matlab, how ?

1 view (last 30 days)
i need to write a code that can calculates the square root of a positive real number, it has to ask N which is the positive real number and then ask for x1 which is the initial best guess for the root and then ask for the maximum number of iterations ask finally ask for E which is the acceptable percentage tolerance, the script has to keep calculating until the max number of iteration is reached or the approx error is less than the acceptable tolerance. i am given that Xi+1 = 1/2[Xi+(N/Xi)] and the approx error is |(Xi+1 - Xi)/Xi+1|x100,, thank you in advance
  1 Comment
Geoff Hayes
Geoff Hayes on 2 Dec 2015
zee - you must have discussed the algorithm in class (else you can find it using your favourite search engine). Once you have the algorithm (and understand it) try implementing it in MATLAB. If you encounter any problems or errors, then post the code and your issue to your question so that you can receive some help.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!